Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing race condition with disconnects during reconnects

  • Loading branch information...
commit 419e1cf356882bbd2558bc89c1f618101cb32144 1 parent d980324
@silentsound authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 baiocas/client.py
View
5 baiocas/client.py
@@ -244,13 +244,14 @@ def _handle_connect_failure(self, message, exception):
def _handle_connect_response(self, message):
self.log.debug('Handling connect response')
+ if self.is_disconnected:
+ self.log.debug('Client disconnected, discarding connect response')
+ return
self._connected = message.successful
if self._connected:
self.log.info('Client is now connected')
self._notify_listeners(ChannelId.META_CONNECT, message)
action = self._advice[Message.FIELD_RECONNECT]
- if self.is_disconnected:
- action = Message.RECONNECT_NONE
if action == Message.RECONNECT_RETRY:
self._reset_backoff_period()
self._delay_connect()
Please sign in to comment.
Something went wrong with that request. Please try again.