Skip to content

Commit 8921452

Browse files
authored
Change ConnectionPool size to not use an iterator (#3015)
1 parent 233abcc commit 8921452

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

gems/aws-sdk-core/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Unreleased Changes
22
------------------
33

4+
* Issue - Fix issue where `ConnectionPool` size iteration would prevent a new key from being added to the pool.
5+
46
3.194.1 (2024-05-03)
57
------------------
68

gems/aws-sdk-core/lib/seahorse/client/net_http/connection_pool.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,7 @@ def session_for(endpoint, &block)
119119
# pool, not counting those currently in use.
120120
def size
121121
@pool_mutex.synchronize do
122-
size = 0
123-
@pool.each_pair do |endpoint,sessions|
124-
size += sessions.size
125-
end
126-
size
122+
@pool.values.flatten.size
127123
end
128124
end
129125

0 commit comments

Comments
 (0)