python-memcached misses working backend

Bug #1380670 reported by Alexander Makarov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python Memcached
New
Undecided
Unassigned

Bug Description

In multi-backend case there is always a chance for client to miss a working backend among not responding.

Assuming memcached is up and running on localhost:11211:

import memcache
import random
cl = memcache.Client(['localhost:11211', 'localhost:11212', 'localhost:11213', 'localhost:11214'])
while cl.set(str(random.random()), 1): pass

'while' must be an infinite loop since cl.set() returns True on success but it exits in milliseconds instead.

Bug may be fixed by changing backend selection logic, patch attached.

The other way is to use https://github.com/linsomniac/python-memcached2/ as linsomniac suggested: https://github.com/linsomniac/python-memcached/pull/57

Revision history for this message
Alexander Makarov (amakarov) wrote :
description: updated
description: updated
Dolph Mathews (dolph)
affects: keystone → python-memcached
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.