Skip to content

Commit 761b7e3

Browse files
committed
Removing decreasing of created connections count when releasing not owned by connection pool connection(#2832).
1 parent 05e3094 commit 761b7e3

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
@@ -1533,10 +1533,10 @@ def release(self, connection: "Connection") -> None:
15331533
AfterConnectionReleasedEvent(connection)
15341534
)
15351535
else:
1536-
# pool doesn't own this connection. do not add it back
1537-
# to the pool and decrement the count so that another
1538-
# connection can take its place if needed
1539-
self._created_connections -= 1
1536+
# Pool doesn't own this connection, do not add it back
1537+
# to the pool.
1538+
# The created connections count shouls not be changed,
1539+
# because the connection was not created by the pool.
15401540
connection.disconnect()
15411541
return
15421542

0 commit comments

Comments
 (0)