Skip to content

Commit 585e090

Browse files
authored
Merge pull request #105 from ykitamura-mdsol/fix/memory_leak
Clear thread data in the "checkin" method to fix memory leak
2 parents f49e142 + 0c0436e commit 585e090

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/net/http/persistent/pool.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ def checkin net_http_args
2020

2121
if stack.empty?
2222
@available.push conn, connection_args: net_http_args
23+
24+
Thread.current[@key].delete(net_http_args)
25+
Thread.current[@key] = nil if Thread.current[@key].empty?
2326
end
2427

2528
nil

0 commit comments

Comments
 (0)