apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@gmail.com>
Subject Re: apr_memcache tries a dead server for each request, not every 5 secs as per comment
Date Tue, 25 Sep 2012 18:34:04 GMT
On Tue, Sep 25, 2012 at 11:54 AM, Gavin Shelley <columbusmonkey@me.com> wrote:
>
> 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
>

It looks correct to me.

-- 
Born in Roswell... married an alien...
http://emptyhammock.com/

Mime
View raw message