Skip to content

Commit

Permalink
Merge pull request #34 from Ivashkaization/33-fix-command-hangs-on-cl…
Browse files Browse the repository at this point in the history
…osing-connection-if-nsqd-socket-is-closed-during-message-sending

Catch `writer.wait_closed()` exception to avoid command hanging. #33
  • Loading branch information
shalakhin authored Apr 21, 2021
2 parents adef6cb + 3545d9a commit ed4424d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ansq/tcp/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ async def _do_close(
self._writer.close()
if sys.version_info >= (3, 7):
await self._writer.wait_closed()
finally:
pass
except Exception as e:
self.logger.exception(e)

for future, callback in self._cmd_waiters:
if not future.cancelled():
Expand Down

0 comments on commit ed4424d

Please sign in to comment.