Skip to content

Commit

Permalink
Merge 28119df into backport/vault-6497/invalidate-queue-cancel/grossl…
Browse files Browse the repository at this point in the history
…y-set-teal
  • Loading branch information
hc-github-team-secure-vault-core committed Jun 10, 2022
2 parents 8d45838 + 28119df commit f755dad
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions builtin/logical/database/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,15 @@ func (b *databaseBackend) GetConnectionWithConfig(ctx context.Context, name stri

// invalidateQueue cancels any background queue loading and destroys the queue.
func (b *databaseBackend) invalidateQueue() {
b.Lock()
defer b.Unlock()

// cancel context before grabbing lock to start closing any open connections
// this is safe to do without the lock since it is only written to once in initialization
// and can be canceled multiple times safely
if b.cancelQueue != nil {
b.cancelQueue()
}
b.Lock()
defer b.Unlock()

b.credRotationQueue = nil
}

Expand Down

0 comments on commit f755dad

Please sign in to comment.