[patch] Retry timeout should be allowed to be zero

Bug #1251482 reported by Tim Starling
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libmemcached
Fix Committed
Wishlist
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

Revision history for this message
Tim Starling (tstarling) wrote :
Revision history for this message
Massive Media (493pocbrcycmdw7yksonho9o2qzz-o18bz-d18ecat4t1b76tkfi3vttrkfngli) wrote :

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

Revision history for this message
Brian Aker (brianaker) wrote :

Looking at this.

Changed in libmemcached:
assignee: nobody → Brian Aker (brianaker)
Revision history for this message
Massive Media (493pocbrcycmdw7yksonho9o2qzz-o18bz-d18ecat4t1b76tkfi3vttrkfngli) wrote :

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)
Changed in libmemcached:
milestone: none → 1.0.18
importance: Undecided → Medium
status: New → In Progress
importance: Medium → Wishlist
Brian Aker (brianaker)
Changed in libmemcached:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.