From de1275adad11f5e4c3ec6221adcbd92c20972113 Mon Sep 17 00:00:00 2001 From: hc-github-team-secure-vault-core <82990506+hc-github-team-secure-vault-core@users.noreply.github.com> Date: Wed, 15 Nov 2023 09:38:03 -0500 Subject: [PATCH] backport of commit 0ab8cfdff681dc42753e080481ae3e9dca6e4031 (#24138) Co-authored-by: davidadeleon <56207066+davidadeleon@users.noreply.github.com> --- 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 000000000..0fcb8ac2e --- /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 609b01493..c6f7cd990 100644 --- a/vault/quotas/quotas.go +++ b/vault/quotas/quotas.go @@ -814,6 +814,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