Make python-memcache work on memcache restarts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python Memcached |
Fix Released
|
Undecided
|
Sean Reifschneider | ||
Debian |
New
|
Undecided
|
Unassigned |
Bug Description
If you try this scenario, the lib will fail because the socket is closed on dead servers, even if those servers are back :
>>> import memcache
>>> c = memcache.
>>> c.set('1', 'ok'); c.get('1')
True
'ok'
<RESTART MEMCACHE SERVER HERE AND WAIT MORE THAN 30 SECONDS>
>>> c.get('1')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/
return self._get('get', key)
File "/home/
rkey, flags, rlen, = self._expectval
File "/home/
if line[:5] == 'VALUE':
TypeError: 'NoneType' object is unsubscriptable
My patch prevents this by resending the query once if the socket is found close. This makes python-memcached working fine when the memcache server is restarted.
Note that the patch includes changes from https:/
Changed in python-memcached: | |
status: | Fix Committed → Fix Released |
rewriting a cleaner patch