backport of commit b0fef53184 (#23295)

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
This commit is contained in:
hc-github-team-secure-vault-core
2023-09-26 17:09:35 -04:00
committed by GitHub
parent 0943b82368
commit df6180f9b5
2 changed files with 11 additions and 1 deletions

View File

@@ -91,6 +91,15 @@ func (a *acmeState) Initialize(b *backend, sc *storageContext) error {
return nil
}
func (a *acmeState) Shutdown(b *backend) {
// If we aren't the active node, nothing to shutdown
if b.System().ReplicationState().HasState(consts.ReplicationDRSecondary | consts.ReplicationPerformanceStandby) {
return
}
a.validator.Closing <- struct{}{}
}
func (a *acmeState) markConfigDirty() {
a.configDirty.Store(true)
}

View File

@@ -430,7 +430,8 @@ func (b *backend) initialize(ctx context.Context, ir *logical.InitializationRequ
func (b *backend) cleanup(ctx context.Context) {
sc := b.makeStorageContext(ctx, b.storage)
b.acmeState.validator.Closing <- struct{}{}
b.acmeState.Shutdown(b)
b.cleanupEnt(sc)
}