diff --git a/lib/vault/client.rb b/lib/vault/client.rb index cc82f407..a4656cf5 100644 --- a/lib/vault/client.rb +++ b/lib/vault/client.rb @@ -164,8 +164,10 @@ def pool # Shutdown any open pool connections. Pool will be recreated upon next request. def shutdown - @nhp.shutdown() - @nhp = nil + @lock.synchronize do + @nhp.shutdown() + @nhp = nil + end end # Creates and yields a new client object with the given token. This may be