It looks like that the new php version has a problem with talking to beanstalkd on a local socket. example code: $packet = stream_get_line($this->_connection, 16384, "\r\n"); see: $packet = stream_get_line($this->_connection, 16384, "\r\n"); Reproducible: Always Steps to Reproduce: 1. Start to talk with beanstalkd 2. Wait for Timeout 3. Actual Results: operation needs more than 60s Expected Results: operation should be done in less than a second
URL of the code: https://github.com/davidpersson/beanstalk/blob/master/src/Socket/Beanstalk.php#L190
To simplify things (I have no idea what beanstalkd is) I created (copied) this script to test stream_get_line. It is working as expected for me on php 5.3.9. <?php $fp = fsockopen("www.google.com", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $out = "GET / HTTP/1.1\r\n"; $out .= "Host: www.google.com\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { echo stream_get_line($fp, 128); } fclose($fp); }
As I received no further feedback, I am closing this one as worksforme. Please reopen if a simple example of how to reproduce this bug is found.
(In reply to comment #3) > As I received no further feedback, I am closing this one as worksforme. Please > reopen if a simple example of how to reproduce this bug is found. There is a bug filed at PHP and at beanstalkd. Today a patch was submitted here: svn diff http://svn.php.net/repository/php/php-src/branches/PHP_5_3/main/streams/streams.c@322581 http://svn.php.net/repository/php/php-src/branches/PHP_5_3/main/streams/streams.c@322582 How can i put an additional .patch file into the php-patchset file? I'm always getting errors: ***** 016_all_stream_get_line.patch ***** PWD: /var/tmp/portage/dev-lang/php-5.3.9-r1/work/php-5.3.9 ========================================= PATCH COMMAND: patch -p0 -g0 -E --no-backup-if-mismatch < '/var/tmp/portage/dev-lang/php-5.3.9-r1/work/5.3.9/generic/016_all_stream_get_line.patch' ========================================= can't find file to patch at input line 4 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff -u a/ext/curl/streams.c b/ext/curl/streams.c |--- a/ext/curl/streams.c (Revision 322581) |+++ b/ext/curl/streams.c (Revision 322582) -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored
The bugs can be found here: https://bugs.php.net/bug.php?id=60719 https://github.com/kr/beanstalkd/issues/88
The easiest way is to drop the patch into /etc/portage/patches/dev-lang/php/
Thanks. The patch applied fine from the /etc.. dir I will test the patch against 5.3.9 soon an report if it worked.