Skip to content

Commit eeb8aed

Browse files
committed
Removing decreasing of created connections count when releasing not owned by connection pool connection(#2832).
1 parent 75cac31 commit eeb8aed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

redis/connection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,10 +1540,10 @@ def release(self, connection: "Connection") -> None:
15401540
AfterConnectionReleasedEvent(connection)
15411541
)
15421542
else:
1543-
# pool doesn't own this connection. do not add it back
1544-
# to the pool and decrement the count so that another
1545-
# connection can take its place if needed
1546-
self._created_connections -= 1
1543+
# Pool doesn't own this connection, do not add it back
1544+
# to the pool.
1545+
# The created connections count shouls not be changed,
1546+
# because the connection was not created by the pool.
15471547
connection.disconnect()
15481548
return
15491549

0 commit comments

Comments
 (0)