|  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: 2021-06-09 11:24 UTC
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: cmb (profile)
Status: Closed Package: memcached (PECL)
PHP Version: 5.3.2 OS: CentOS 4.8 (x86_64)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
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.
 [2021-06-09 11:24 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-06-09 11:24 UTC]
The memcached bug tracker is now on Github[1].  If this is still
an issue with the current memcached version, please report there.

[1] <>
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 24 20:01:29 2024 UTC