-
Notifications
You must be signed in to change notification settings - Fork 326
When I use memcached, memcached has a bad effect on pfsockopen function #313
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
Comments
That is a really interesting bug, thank you for the detailed information. I don't have a version of PHP 5.4 available to test with. I would ask to confirm that the bug still occurs on PHP 5.6 with memcached extension 2.x, or on PHP 7.x with memcached extension 3.x, to make sure that it remains a current bug. I will try your repro script! |
thank you for your reply |
@lizhibin205 Do you mean that the problem only happens with PHP 5.4 and it is fixed in PHP 5.6? |
yes! And I debug with php5.4.41,I found this:
and then
so , I think if last errno equal EWOULDBLOCK ,php will judge that socket is alive. |
anyway,i also review php-5.6.30, php_sockop_set_option function in main/streams/xp_socket.c
so , it can explain that this bug won't occour in php5.6. when revc return 0 ,php will judge that socket is die |
Excellent debugging! But do you think there is anything to fix in memcached, or is this a PHP problem only? Since PHP 5.4 is not supported anymore, is it OK to close this bug and to recommend that everyone must upgrade their PHP if they see this problem? |
OK |
Uh oh!
There was an error while loading. Please reload this page.
when I use memcached, memcached has an bad effect on pfsockopen function. pfsockopen can't check whether the TCP link is alive.
Here is my php code:
I have used strace command to find the reason:
if no memcached used,pfsockopen will reconnect:
OK, my php version is:
PHP 5.4.41 (cli) (built: Nov 22 2015 21:42:54)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with eAccelerator v1.0-dev, Copyright (c) 2004-2012 eAccelerator, by eAccelerator
And memcached version is:
memcached support => enabled
Version => 2.2.0
libmemcached version => 1.0.18
The text was updated successfully, but these errors were encountered: