-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
PythonParser's on_disconnect implementation is inconsistent with HiredisParser implementation (or vice versa):
class PythonParser(...):
def on_disconnect(self):
"Called when the socket disconnects"
if self._sock is not None:
self._sock.close()
self._sock = None
if self._buffer is not None:
self._buffer.close()
self._buffer = None
self.encoder = Noneand
class HiredisParser(...):
def on_disconnect(self):
self._sock = None
self._reader = None
self._next_response = FalseWhy does the PythonParser closes the _sock object?
By doing this the subsequent shutdown() and close() in Connection.disconnect does not make any sense, in fact it shutdown on closed socket raises error which is ignored.
I can submit a PR but please tell me what place to fix? (HiredisParser/PythonParser/shutdown)
PS: this issue causes other issues in other repos (celery/kombu#954, celery/celery#3898)
theodespwolph
Metadata
Metadata
Assignees
Labels
No labels