Unclosed connection leak when replacing pooled connection in SharedTimedStack.try_create (#37335)

This commit is contained in:
Shlee 2026-01-28 20:44:03 +10:30 committed by GitHub
parent 6af4696c70
commit d438161b9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -71,6 +71,7 @@ class ConnectionPool::SharedTimedStack
throw_away_connection = @queue.pop
@tagged_queue[throw_away_connection.site].delete(throw_away_connection)
@create_block.call(preferred_tag)
throw_away_connection.close
elsif @created != @max
connection = @create_block.call(preferred_tag)
@created += 1