From c0c9b22da057944ce55bff36e47d57ade4ebe669 Mon Sep 17 00:00:00 2001 From: Pavlo Date: Tue, 27 Feb 2024 19:41:10 +0200 Subject: [PATCH] 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 --- lib/vault/client.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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