X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fquit.cc;h=5d17b3133e76375e92d8f88498ee73d52784e967;hb=bf2fa8274d569da94a626eea30de612f01ec4a7c;hp=7ece03b9bbabad323c11a58480f01b21277989a9;hpb=28d3641c8331dfe348a119c6eb4bd776c526da48;p=awesomized%2Flibmemcached diff --git a/libmemcached/quit.cc b/libmemcached/quit.cc index 7ece03b9..5d17b313 100644 --- a/libmemcached/quit.cc +++ b/libmemcached/quit.cc @@ -93,6 +93,7 @@ namespace { * sent to the server. */ instance->server_failure_counter= 0; + instance->server_timeout_counter= 0; } } @@ -120,8 +121,15 @@ void memcached_quit_server(memcached_instance_st* instance, bool io_death) instance->close_socket(); - if (io_death) + if (io_death and memcached_is_udp(instance->root)) { + /* + If using UDP, we should stop using the server briefly on every IO + failure. If using TCP, it may be that the connection went down a + short while ago (e.g. the server failed) and we've only just + noticed, so we should only set the retry timeout on a connect + failure (which doesn't call this method). + */ memcached_mark_server_for_timeout(instance); } }