Skip to content

Commit

Permalink
call socket.shutdown() before socket.close()
Browse files Browse the repository at this point in the history
  • Loading branch information
andymccurdy committed Aug 23, 2013
1 parent 3d4347d commit 0ef6517
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CHANGES
Expand Up @@ -3,7 +3,12 @@
Thanks leifkb.
* Added SENTINEL command. Thanks Anna Janackova.
* Fixed a bug where pipelines could potentially correct a connection
if the MULTI command generated a ResponseError
if the MULTI command generated a ResponseError. Thanks EliFinkelshteyn
for the report.
* Connections now call socket.shutdown() prior to socket.close() to
ensure communication ends immediately per the note at
http://docs.python.org/2/library/socket.html#socket.socket.close
Thanks to David Martin for pointing this out.
* 2.7.6
* Added CONFIG RESETSTAT command. Thanks Yossi Gottlieb.
* Fixed a bug introduced in 2.7.3 that caused issues with script objects
Expand Down
1 change: 1 addition & 0 deletions redis/connection.py
Expand Up @@ -276,6 +276,7 @@ def disconnect(self):
if self._sock is None:
return
try:
self._sock.shutdown(socket.SHUT_RDWR)
self._sock.close()
except socket.error:
pass
Expand Down

0 comments on commit 0ef6517

Please sign in to comment.