nicholasserra/python-ultramemcached — pull request #2 by justinvf (2012-09-14 23:35:42+00:00)
Title: Fix Race Condition in python-ultramemcached

Previous code would call get/gets and save the value to `response`.

We then would call get/gets again and unpack the return results to either a 2-tuple or 3-tuple.

If the key was deleted from memcached between the first get/gets and the second get/gets, we would try to unpack `None`. This raises an exception.

The fix is to just use the original `response` that was queried and unpack that.

This has the side benefit of reducing in half the calls to memcache.