diff options
| author | Sean Reifschneider <jafo@tummy.com> | 2011-11-27 17:44:51 -0700 |
|---|---|---|
| committer | Sean Reifschneider <jafo@tummy.com> | 2011-11-27 17:44:51 -0700 |
| commit | 25bf14164158e97a045239b7681c3d508a2aa17c (patch) | |
| tree | 705e114c1e1a26316d0016eee0c5c2e728727547 | |
| parent | a1910ce357b55e132886d8af1ba7858e2a929d5f (diff) | |
| download | python-memcached-25bf14164158e97a045239b7681c3d508a2aa17c.tar.gz | |
* Bug #713451: server.expect("END") needs to be in a finally block
Expect an "END" when the _recv_value() raises an exception.
Patch by Jay Farrimond.
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | memcache.py | 6 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,7 @@ + * Bug #713451: server.expect("END") needs to be in a finally block + Expect an "END" when the _recv_value() raises an exception. + Patch by Jay Farrimond. + * Bug: #741090: cas cache can grow unbounded. Default now is that the cache is not used, unless the "Client()" object is created with "cache_cas=True". In that case, you need to have your own cas clearing diff --git a/memcache.py b/memcache.py index e007c57..9a50407 100644 --- a/memcache.py +++ b/memcache.py @@ -826,8 +826,10 @@ class Client(local): if not rkey: return None - value = self._recv_value(server, flags, rlen) - server.expect("END") + try: + value = self._recv_value(server, flags, rlen) + finally: + server.expect("END") except (_Error, socket.error), msg: if isinstance(msg, tuple): msg = msg[1] server.mark_dead(msg) |
