|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59225 getStats returns NULL when a server in the pool is down
Submitted: 2010-05-20 16:02 UTC Modified: -
Avg. Score:4.0 ± 0.8
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: thunberg at gmail dot com Assigned:
Status: Open Package: memcached (PECL)
PHP Version: 5.3.2 OS: CentOS 4.8 (x86_64)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: thunberg at gmail dot com
New email:
PHP Version: OS:


 [2010-05-20 16:02 UTC] thunberg at gmail dot com
I expanded my single memcached server setup to include a pool 
of memcached servers and in the process took a few minutes to 
make a simple status script:

The problem is when one server goes down all the operations 
(set, get, etc) continue fine, but getStats returns NULL and 
the result code is Memcached::RES_SOME_ERRORS.

Anyway this could return the normal array of servers, the 
stats for the alive ones, and NULL for any that are down?

Thanks in advance for the help.

Reproduce code:
$array = array(													array('', 11211, 25),	// alive
array('', 11211, 25),	// alive						array('', 11211, 25),	// alive
array('', 11211, 25)	// dead


Expected result:
Associative array indexed by host:port with stats for alive 
servers and NULL or some other indication that a server is 

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-20 20:27 UTC] pep at neanderthal-technology dot com
Tried to reproduce this on 2 different platforms but it worked the way expected 

Platform: Ubuntu 10.04
PHP: 5.3.2
libmemcached: 1.0.2

Platform: CentOS 6.4
PHP: 5.4.15
libmemcached: 1.0.10

Reproduce code:
$mc = new \Memcached();
$array = array(
array('', 11211, 25), // up
array('', 11211, 25), // down

Expected result:
'' => array(..),
'' => array(..),

Actual result:
'' => array('pid' => int(6647), ..),
'' => array('pid' => int(-1)..),

The negative pid indicates the server is unavailable.
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Dec 16 12:01:23 2019 UTC