From 409b488619c121e786e8538d7fde5c9229c247ed Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Cruz?= Date: Wed, 3 Mar 2010 12:01:54 +0000 Subject: [PATCH] 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. --- libmemcached/storage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.30.2