[patch] Retry timeout should be allowed to be zero

Bug #1251482 reported by Tim Starling on 2013-11-15
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Brian Aker

Bug Description

Immediate reconnection after a failure is a reasonable policy, especially in cases where there is only one memcached server. We use twemproxy, so our PHP clients typically have only one server configured. So, libmemcached should allow MEMCACHED_BEHAVIOR_RETRY_TIMEOUT to be set to zero. This is pretty straightforward -- a patch is attached, tested against libmemcached 1.0.17 with current PECL memcached.

Since the retry timeout is causing tens of failures per second for us, root cause unknown, we are planning on deploying this patch immediately as a workaround. See https://bugzilla.wikimedia.org/show_bug.cgi?id=56882

The patch simply wraps the section of memcached_mark_server_for_timeout() which sets next_retry with

    if (server->root->retry_timeout != 0)

and allows it to be set to zero in behavior.cc

Related branches

Tim Starling (tstarling) wrote :

You can set it to -1, it should work too

Brian Aker (brianaker) wrote :

Looking at this.

Changed in libmemcached:
assignee: nobody → Brian Aker (brianaker)

Please also check https://answers.launchpad.net/libmemcached/+question/239497 , it's related to it and we're having issues with this as well.

Brian Aker (brianaker) on 2013-11-20
Changed in libmemcached:
milestone: none → 1.0.18
importance: Undecided → Medium
status: New → In Progress
importance: Medium → Wishlist
Brian Aker (brianaker) on 2014-02-01
Changed in libmemcached:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers