Skip to content

Commit

Permalink
ignore errors raised in SocketBuffer's close method. See redis#633.
Browse files Browse the repository at this point in the history
  • Loading branch information
andymccurdy committed Nov 2, 2015
1 parent 4001afc commit 69e38ce
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions redis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,16 @@ def purge(self):
self.bytes_read = 0

def close(self):
self.purge()
self._buffer.close()
try:
self.purge()
self._buffer.close()
except:
# issue #633 suggests the purge/close someone raised a
# BadFileDescriptor error. Perhaps the client ran out of
# memory or something else? It's probably OK to ignore
# any error being raised from purge/close since we're
# removing the the reference to the instance below.
pass
self._buffer = None
self._sock = None

Expand Down

0 comments on commit 69e38ce

Please sign in to comment.