From 0ab8cfdff681dc42753e080481ae3e9dca6e4031 Mon Sep 17 00:00:00 2001 From: davidadeleon <56207066+davidadeleon@users.noreply.github.com> Date: Wed, 15 Nov 2023 08:49:29 -0500 Subject: [PATCH] [VAULT-21623] Close rate-limit client purge goroutines when sealing (#24108) * close purge goroutines when sealing * add changelog --- changelog/24108.txt | 3 +++ vault/quotas/quotas.go | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 changelog/24108.txt diff --git a/changelog/24108.txt b/changelog/24108.txt new file mode 100644 index 0000000000..0fcb8ac2e5 --- /dev/null +++ b/changelog/24108.txt @@ -0,0 +1,3 @@ +```release-note:bug +core/quotas: Close rate-limit blocked client purge goroutines when sealing +``` \ No newline at end of file diff --git a/vault/quotas/quotas.go b/vault/quotas/quotas.go index 05fc7a7130..c765a51e88 100644 --- a/vault/quotas/quotas.go +++ b/vault/quotas/quotas.go @@ -865,6 +865,13 @@ func (m *Manager) resetCache() error { } if quota != nil { rlq := quota.(*RateLimitQuota) + + // Cancel the quota's purgeBlockedClients goroutine + err = rlq.close(context.Background()) + if err != nil { + return err + } + err = rlq.store.Close(context.Background()) if err != nil { return err