Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions hazelcast/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ def on_auth(self, f, connection, address):
self.logger.info("Authenticated with %s", f.result())
with self._new_connection_mutex:
self.connections[connection.endpoint] = f.result()
self._pending_connections.pop(address)
try:
self._pending_connections.pop(address)
except KeyError:
pass
for on_connection_opened, _ in self._connection_listeners:
if on_connection_opened:
on_connection_opened(f.resul())
Expand All @@ -147,7 +150,10 @@ def on_auth(self, f, connection, address):
def _connection_closed(self, connection, cause):
# if connection was authenticated, fire event
if connection.endpoint:
self.connections.pop(connection.endpoint)
try:
self.connections.pop(connection.endpoint)
except KeyError:
pass
for _, on_connection_closed in self._connection_listeners:
if on_connection_closed:
on_connection_closed(connection, cause)
Expand Down