|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-08-20 21:39 UTC] pep at neanderthal-technology dot com
[2021-06-09 11:53 UTC] cmb@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: cmb
[2021-06-09 11:53 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 16:00:02 2025 UTC |
Description: ------------ Using getStats() after a get() is anomalous. And no further set() or get() can be executed on same script. Walking through these steps: 1.getStats() 2.get($key_name) 3.getStats() 4.getStats() the 3rd return a pid of -1 while 1 and 4 are returning the valid connection And this way 1.getStats() 2.get($key_name) 3.getStats() 4.get($different_key) Makes get of step 4 return the content of step 2. Test script: --------------- // Creates new object $Memcached = new Memcached('pepe'); $Memcached->setOption(Memcached::OPT_COMPRESSION, true); $Memcached->setOption(Memcached::SERIALIZER_IGBINARY, true); $Memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, true); // Connects to a pool of servers $Memcached->addServer("127.0.0.1", "11211"); var_dump($Memcached->getStats()); $Memcached->set("Content 1", "This is content ONE"); var_dump($Memcached->getStats()); $Content = $Memcached->get("Content 1"); var_dump($Content); var_dump($Memcached->getStats()); $Memcached->set("Content 2", "This is content TWO"); var_dump($Memcached->getStats()); $Content = $Memcached->get("Content 2"); var_dump($Content); var_dump($Memcached->getStats()); Expected result: ---------------- It has to return always tha valid connection: array (size=1) '127.0.0.1:11211' => array (size=24) 'pid' => int 7008 'uptime' => int 4200 'threads' => int 4 'time' => int 1372161606 'pointer_size' => int 32 'rusage_user_seconds' => int 0 'rusage_user_microseconds' => int 3999 'rusage_system_seconds' => int 0 'rusage_system_microseconds' => int 18997 'curr_items' => int 4 'total_items' => int 26 'limit_maxbytes' => int 16777216 'curr_connections' => int 9 'total_connections' => int 64 'connection_structures' => int 10 'bytes' => int 18692 'cmd_get' => int 85 'cmd_set' => int 27 'get_hits' => int 54 'get_misses' => int 31 'evictions' => int 0 'bytes_read' => int 45196 'bytes_written' => int 339517 'version' => string '1.4.5' (length=5) array (size=1) '127.0.0.1:11211' => array (size=24) 'pid' => int 7008 'uptime' => int 4200 'threads' => int 4 'time' => int 1372161606 'pointer_size' => int 32 'rusage_user_seconds' => int 0 'rusage_user_microseconds' => int 3999 'rusage_system_seconds' => int 0 'rusage_system_microseconds' => int 18997 'curr_items' => int 4 'total_items' => int 27 'limit_maxbytes' => int 16777216 'curr_connections' => int 9 'total_connections' => int 64 'connection_structures' => int 10 'bytes' => int 18692 'cmd_get' => int 85 'cmd_set' => int 28 'get_hits' => int 54 'get_misses' => int 31 'evictions' => int 0 'bytes_read' => int 45280 'bytes_written' => int 340972 'version' => string '1.4.5' (length=5) string 'This is content ONE' (length=19) array (size=1) '127.0.0.1:11211' => array (size=24) 'pid' => int 7008 'uptime' => int 4200 'threads' => int 4 'time' => int 1372161606 'pointer_size' => int 32 'rusage_user_seconds' => int 0 'rusage_user_microseconds' => int 3999 'rusage_system_seconds' => int 0 'rusage_system_microseconds' => int 18997 'curr_items' => int 4 'total_items' => int 26 'limit_maxbytes' => int 16777216 'curr_connections' => int 9 'total_connections' => int 64 'connection_structures' => int 10 'bytes' => int 18692 'cmd_get' => int 85 'cmd_set' => int 27 'get_hits' => int 54 'get_misses' => int 31 'evictions' => int 0 'bytes_read' => int 45196 'bytes_written' => int 339517 'version' => string '1.4.5' (length=5) array (size=1) '127.0.0.1:11211' => array (size=24) 'pid' => int 7008 'uptime' => int 4200 'threads' => int 4 'time' => int 1372161606 'pointer_size' => int 32 'rusage_user_seconds' => int 0 'rusage_user_microseconds' => int 3999 'rusage_system_seconds' => int 0 'rusage_system_microseconds' => int 18997 'curr_items' => int 4 'total_items' => int 26 'limit_maxbytes' => int 16777216 'curr_connections' => int 9 'total_connections' => int 64 'connection_structures' => int 10 'bytes' => int 18692 'cmd_get' => int 85 'cmd_set' => int 27 'get_hits' => int 54 'get_misses' => int 31 'evictions' => int 0 'bytes_read' => int 45196 'bytes_written' => int 339517 'version' => string '1.4.5' (length=5) string 'This is content TWO' (length=19) array (size=1) '127.0.0.1:11211' => array (size=24) 'pid' => int 7008 'uptime' => int 4200 'threads' => int 4 'time' => int 1372161606 'pointer_size' => int 32 'rusage_user_seconds' => int 0 'rusage_user_microseconds' => int 3999 'rusage_system_seconds' => int 0 'rusage_system_microseconds' => int 18997 'curr_items' => int 4 'total_items' => int 26 'limit_maxbytes' => int 16777216 'curr_connections' => int 9 'total_connections' => int 64 'connection_structures' => int 10 'bytes' => int 18692 'cmd_get' => int 85 'cmd_set' => int 27 'get_hits' => int 54 'get_misses' => int 31 'evictions' => int 0 'bytes_read' => int 45196 'bytes_written' => int 339517 'version' => string '1.4.5' (length=5) Actual result: -------------- array (size=1) '127.0.0.1:11211' => array (size=24) 'pid' => int 7008 'uptime' => int 4200 'threads' => int 4 'time' => int 1372161606 'pointer_size' => int 32 'rusage_user_seconds' => int 0 'rusage_user_microseconds' => int 3999 'rusage_system_seconds' => int 0 'rusage_system_microseconds' => int 18997 'curr_items' => int 4 'total_items' => int 26 'limit_maxbytes' => int 16777216 'curr_connections' => int 9 'total_connections' => int 64 'connection_structures' => int 10 'bytes' => int 18692 'cmd_get' => int 85 'cmd_set' => int 27 'get_hits' => int 54 'get_misses' => int 31 'evictions' => int 0 'bytes_read' => int 45196 'bytes_written' => int 339517 'version' => string '1.4.5' (length=5) array (size=1) '127.0.0.1:11211' => array (size=24) 'pid' => int 7008 'uptime' => int 4200 'threads' => int 4 'time' => int 1372161606 'pointer_size' => int 32 'rusage_user_seconds' => int 0 'rusage_user_microseconds' => int 3999 'rusage_system_seconds' => int 0 'rusage_system_microseconds' => int 18997 'curr_items' => int 4 'total_items' => int 27 'limit_maxbytes' => int 16777216 'curr_connections' => int 9 'total_connections' => int 64 'connection_structures' => int 10 'bytes' => int 18692 'cmd_get' => int 85 'cmd_set' => int 28 'get_hits' => int 54 'get_misses' => int 31 'evictions' => int 0 'bytes_read' => int 45280 'bytes_written' => int 340972 'version' => string '1.4.5' (length=5) string 'This is content ONE' (length=19) array (size=1) '127.0.0.1:11211' => array (size=24) 'pid' => int -1 'uptime' => int 0 'threads' => int 0 'time' => int 0 'pointer_size' => int 0 'rusage_user_seconds' => int 0 'rusage_user_microseconds' => int 0 'rusage_system_seconds' => int 0 'rusage_system_microseconds' => int 0 'curr_items' => int 0 'total_items' => int 0 'limit_maxbytes' => int 0 'curr_connections' => int 0 'total_connections' => int 0 'connection_structures' => int 0 'bytes' => int 0 'cmd_get' => int 0 'cmd_set' => int 0 'get_hits' => int 0 'get_misses' => int 0 'evictions' => int 0 'bytes_read' => int 0 'bytes_written' => int 0 'version' => string '' (length=0) array (size=1) '127.0.0.1:11211' => array (size=24) 'pid' => int -1 'uptime' => int 0 'threads' => int 0 'time' => int 0 'pointer_size' => int 0 'rusage_user_seconds' => int 0 'rusage_user_microseconds' => int 0 'rusage_system_seconds' => int 0 'rusage_system_microseconds' => int 0 'curr_items' => int 0 'total_items' => int 0 'limit_maxbytes' => int 0 'curr_connections' => int 0 'total_connections' => int 0 'connection_structures' => int 0 'bytes' => int 0 'cmd_get' => int 0 'cmd_set' => int 0 'get_hits' => int 0 'get_misses' => int 0 'evictions' => int 0 'bytes_read' => int 0 'bytes_written' => int 0 'version' => string '' (length=0) boolean false array (size=1) '127.0.0.1:11211' => array (size=24) 'pid' => int -1 'uptime' => int 0 'threads' => int 0 'time' => int 0 'pointer_size' => int 0 'rusage_user_seconds' => int 0 'rusage_user_microseconds' => int 0 'rusage_system_seconds' => int 0 'rusage_system_microseconds' => int 0 'curr_items' => int 0 'total_items' => int 0 'limit_maxbytes' => int 0 'curr_connections' => int 0 'total_connections' => int 0 'connection_structures' => int 0 'bytes' => int 0 'cmd_get' => int 0 'cmd_set' => int 0 'get_hits' => int 0 'get_misses' => int 0 'evictions' => int 0 'bytes_read' => int 0 'bytes_written' => int 0 'version' => string '' (length=0)