-
Notifications
You must be signed in to change notification settings - Fork 326
Closed
Description
Hi,
I'm having some trouble with the getStats
method. When any of the servers on the pool is down, getStats
returns false
, so statistics from the servers that are still up cannot be read.
Is this the expected behavior? I was expecting to get at least the stats for the rest of the servers, but I'm not sure if this is like that by design.
I'm using PHP 7.1.3, Memcached 3.0.3 and libmemcached 1.0.16.
Sample code:
<?php
$m = new Memcached('example');
$m->setOptions([
Memcached::OPT_SERVER_FAILURE_LIMIT => 2,
Memcached::OPT_RETRY_TIMEOUT => 1,
Memcached::OPT_DISTRIBUTION => Memcached::DISTRIBUTION_CONSISTENT,
]);
// Working server
$m->addServer('127.0.0.1', '11211', 1);
var_dump($m->getStats());
var_dump($m->getVersion());
// Everything is OK
// We add a "fake" non working server
$m->addServer('127.0.0.1', '11111', 1);
var_dump($m->getStats()); // bool(false)
echo 'Message: ' . $m->getResultMessage() . "\n"; // CONNECTION FAILURE
var_dump($m->getVersion()); // bool(false)
Thank you!
Metadata
Metadata
Assignees
Labels
No labels