Do not attempt to shutdown ACME thread on non-active nodes (#23293) (#23294)

Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
This commit is contained in:
hc-github-team-secure-vault-core 2023-09-26 17:01:17 -04:00 committed by GitHub
parent c08d731634
commit 6a15309a2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 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

@ -449,7 +449,7 @@ func (b *backend) initialize(ctx context.Context, _ *logical.InitializationReque
}
func (b *backend) cleanup(_ context.Context) {
b.acmeState.validator.Closing <- struct{}{}
b.acmeState.Shutdown(b)
}
func (b *backend) initializePKIIssuersStorage(ctx context.Context) error {