-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stopped working with OpenSSL changes in PHP 5.6.7 #84
Comments
Reproducable with PHP 5.6.7 and 5.5.23. |
Same here… socket timeout slows down the stream to 60seconds per read… Tried to set timeout socket to a short time but doesn't affect when calling via CGI. PHP fixed bug #61285, #68329, #68046, #41631 (encrypted streams don't observe socket timeouts). |
Looks like rolling back to PHP 5.6.6 is the best alternative right now |
Same issue with 5.5.23 upgrade from 5.5.22 Any PPA's for 5.5.22 ?? . deb.sury is 5.5.23 :( ubuntu 12.04 anyone, any workarounds? Full 5.5.22 -> 5.5.23 diff here Original git merge thread |
php issue submitted |
could that also affect PECL over proxy? https://pecl.php.net/package-changelog.php?package=pecl_http&release=2.4.3 |
@EugenMayer not sure, not using that package. try changing the
value, it uses that timeout for socket operations.. and check difference if using 5.5.22 and 5.5.23 i'am using this workaround atm
on dev machines where i can upgrade, not a workaround for production tho. |
Though this bug has been fixed upstream, it wasn't discovered until 5.5.23 and 5.6.7 were already in the RC stage and couldn't be included in these releases. The next set of bugfix releases resolves this issue. hi everyone, the bug was confirmed and the fix is in upstream, everyone interested in ApnsPHP invited to use https://packagist.org/packages/sshilko/backq https://github.com/sshilko/backq as a solution to dispatch push notifications, its stable and in production.
|
Issue still occurs in 5.5.24. |
5.6.8 and 5.5.24 were in RC already, fix expected in 5.5.25.. look into
|
I did. Had assumed that when they say the next set of bugfix release would mean 5.5.24 which it clearly isn't fixed in. |
Fix Bug #69402: Reading empty SSL stream hangs until timeout believe thats the fix and the comment says
|
Ah, gotya. Was reading the bugreport you had posted earlier. Your new comment was not there at the time of writing. Good to know it'll all be fixed for 5.5.25 though. "php issue submitted |
I experience this problem aswell - but I cannot easily downgrade my PHP version. How do you work around this problem? For now ApnsPHP just does not work as long as this bug is still around. Setting socket timeout values has no effect, so what else can be done? |
i mentioned a workaround above, u can control "how long it will be stuck" reading with
this way it will be stuck for 1 second each time it tries to read from socket (when bug happends). |
I already did that - it does not work. The script is still permanently stuck. |
No timeout seems to actually have an effect - without explicitely killing processes they are running forever, never stopping and all using 100% CPU. I have actually had a CPU load of 20000 within 24 hours just because of all the cron jobs calling ApnsPHP. |
do it before you connect, not before you execute read from stream.. worked for me at 5.5.23 and currently works too
and yeah.. |
That is what I did - I called the ini_set command at the very beginning of the script, before anything happens at all. Yet the cron script just goes to 100% CPU and stays there forever - even after 12 hours it is still going, when every possible timeout should have been reached. |
works for me, i'am setting 2 seconds timeout as an stream_socket_client 4th argument, and seeing it work
|
Nope, setting the stream_socket_client connect timeout does not work either - that's a connect timeout, so it should not have any effect on reading from a remote host anyway, as the connection is not the problem. "default_socket_timeout" should have been it, but that definitely does not work, unfortunately. The only thing which works and still lets the script run it course is by commenting out the contents of |
All the workarounds seem to work only if there is no "invalid" (unregistered) APNS token contained in the queue. To me it seems that it works till the first invalid token, all receivers with tokens after that one don't receive messages. Although the log output of ApnsPHP looks completely successful. Maybe the reason is that the APNS server wants to send an error response after an invalid token and, from this point on, the ApnsPHP workaround hinders from successfully communicating with the server. |
apple doc clearly states that messages after error would not be processed maybe iam wrong ')
|
also the workaround was to prevent the 100%cpu load infinitely/60sec . not
|
For me that workaround does the same as commenting the fread line. |
My problem is that I have a list of about 3000 receiver tokens and this list also contains invalid tokens which I don't know. I suppose that sending them 1by1 would be too inefficient. Do you have any suggestions for me? |
jakobjw 1by1 not too inefficient in 1 thread, but if u have 100 workers running should not be an issue, isnt it. |
Seems that the latest PHP 5.6.9 release solves this issue. |
Ditto for PHP 5.5.25; seems like it now works. Phew. |
yes, seems so
Didnt tested yet tho, https://launchpad.net/~ondrej/+archive/ubuntu/php5 updated just 2 days ago |
Times out with the fread() function in the ApnsPHP_Push->_readErrorMessage() method with the changes PHP 5.6.7 made. Reverting back to PHP 5.6.6 (same compile options) and everything back to working.
Not sure it makes a difference, but it's with the OpenSSL 1.0.2a libs.
Haven't had time to dig too much into the underlying issue, but seeing how PHP 5.6.7 made a bunch of changes to OpenSSL and how it handles timeouts, I wonder if they introduced a bug. http://php.net/ChangeLog-5.php#5.6.7
The text was updated successfully, but these errors were encountered: