Skip to content

Commit fb4e0f6

Browse files
fxposterchrisarcand
authored andcommitted
http client's shutdown should be lock-protected
since @nhp is modified within the mutex-protected area, so all its accesses should also be mutex-protected
1 parent f596b69 commit fb4e0f6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/vault/client.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,10 @@ def pool
174174

175175
# Shutdown any open pool connections. Pool will be recreated upon next request.
176176
def shutdown
177-
@nhp.shutdown()
178-
@nhp = nil
177+
@lock.synchronize do
178+
@nhp.shutdown()
179+
@nhp = nil
180+
end
179181
end
180182

181183
# Creates and yields a new client object with the given token. This may be

0 commit comments

Comments
 (0)