Skip to content

Commit c35680b

Browse files
author
egalpin
committed
Clears pool._working_addr if closing connection due to consecutive exceptions
This change will help alleviate any issues in an HA configuration where the server IP is cached by the pool initialization.
1 parent 2d0ce2b commit c35680b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎asyncpg/pool.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ async def maybe_close_bad_connection(self, exc_type):
282282
ifself._consecutive_exceptions>self._max_consecutive_exceptions:
283283
awaitself.close()
284284
self._consecutive_exceptions=0
285+
self._pool._working_addr=None
285286

286287

287288
classPool:

0 commit comments

Comments
(0)