apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gavin Shelley <columbusmon...@me.com>
Subject apr_memcache tries a dead server for each request, not every 5 secs as per comment
Date Tue, 25 Sep 2012 15:54:50 GMT

The comment says:

            /* Try the dead server, every 5 seconds */

but the code looks to try for each request more than 5 seconds after the dead server was first
noticed.

If I'm correct, does the following (untested) patch make sense?




Index: memcache/apr_memcache.c
===================================================================
--- memcache/apr_memcache.c	(revision 1389910)
+++ memcache/apr_memcache.c	(working copy)
@@ -183,8 +183,8 @@
 #endif
             /* Try the dead server, every 5 seconds */
             if (curtime - ms->btime >  apr_time_from_sec(5)) {
+                ms->btime = curtime;
                 if (mc_version_ping(ms) == APR_SUCCESS) {
-                    ms->btime = curtime;
                     make_server_live(mc, ms);
 #if APR_HAS_THREADS
                     apr_thread_mutex_unlock(ms->lock);n


Mime
View raw message