Skip to content

Commit 972d8a2

Browse files
committed
Handle connect exception gracefully
1 parent a24e85e commit 972d8a2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hazelcast/internal/asyncio_reactor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,11 @@ async def _connect_retry_cb(self, timeout, sock, address):
145145
if self._connected and self._close_task:
146146
self._close_task.cancel()
147147
return
148-
self.connect(sock, address)
148+
try:
149+
self.connect(sock, address)
150+
except Exception:
151+
# close task will handle closing the connection
152+
return
149153
if not self._connected:
150154
self._connect_timer_task = self._loop.create_task(
151155
self._connect_retry_cb(timeout, sock, address)

0 commit comments

Comments
 (0)