From: André Cruz Date: Wed, 3 Mar 2010 12:01:54 +0000 (+0000) Subject: If a server is down, repeated stores would increment the fail count even though the... X-Git-Tag: 0.40~16^2~4 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=409b488619c121e786e8538d7fde5c9229c247ed;p=m6w6%2Flibmemcached If a server is down, repeated stores would increment the fail count even though the server is marked by memcached_connect. This caused the next_retry to be incremented when the fail count was reached even though no new attempt was made to connect to the server... The connection to this server would never be recovered if the fail limit was reached before the next_retry. This problem may exist elsewhere with mgets and deletes. --- diff --git a/libmemcached/storage.c b/libmemcached/storage.c index 6225af37..ba66cf87 100644 --- a/libmemcached/storage.c +++ b/libmemcached/storage.c @@ -189,7 +189,8 @@ static inline memcached_return_t memcached_send(memcached_st *ptr, return rc; error: - memcached_io_reset(instance); + if (rc == MEMCACHED_WRITE_FAILURE) + memcached_io_reset(instance); return rc; }