From caf4c7dab12bea6dbd8bdf4c641969a44e6cc719 Mon Sep 17 00:00:00 2001 From: davidadeleon <56207066+davidadeleon@users.noreply.github.com> Date: Wed, 15 Nov 2023 13:49:29 +0000 Subject: [PATCH] backport of commit 0ab8cfdff681dc42753e080481ae3e9dca6e4031 --- 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 000000000000..0fcb8ac2e51a --- /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 cefa3d13cf10..3b52e02e7a25 100644 --- a/vault/quotas/quotas.go +++ b/vault/quotas/quotas.go @@ -831,6 +831,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