mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 11:38:02 +00:00
backport of commit 0ac2fa19aa (#20707)
Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
This commit is contained in:
committed by
GitHub
parent
4aff0037d0
commit
9ef24f6487
@@ -50,15 +50,6 @@ func runUnifiedTransfer(sc *storageContext) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !status.lastRun.IsZero() {
|
|
||||||
// We have run before, we only run again if we have
|
|
||||||
// been requested to forceRerun, and we haven't run since our
|
|
||||||
// minimum delay
|
|
||||||
if !(status.forceRerun.Load() && time.Since(status.lastRun) < minUnifiedTransferDelay) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if !config.UnifiedCRL {
|
if !config.UnifiedCRL {
|
||||||
// Feature is disabled, no need to run
|
// Feature is disabled, no need to run
|
||||||
return
|
return
|
||||||
@@ -77,6 +68,17 @@ func runUnifiedTransfer(sc *storageContext) {
|
|||||||
}
|
}
|
||||||
defer status.isRunning.Store(false)
|
defer status.isRunning.Store(false)
|
||||||
|
|
||||||
|
// Because access to lastRun is not locked, we need to delay this check
|
||||||
|
// until after we grab the isRunning CAS lock.
|
||||||
|
if !status.lastRun.IsZero() {
|
||||||
|
// We have run before, we only run again if we have
|
||||||
|
// been requested to forceRerun, and we haven't run since our
|
||||||
|
// minimum delay.
|
||||||
|
if !(status.forceRerun.Load() && time.Since(status.lastRun) < minUnifiedTransferDelay) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Reset our flag before we begin, we do this before we start as
|
// Reset our flag before we begin, we do this before we start as
|
||||||
// we can't guarantee that we can properly parse/fix the error from an
|
// we can't guarantee that we can properly parse/fix the error from an
|
||||||
// error that comes in from the revoke API after that. This will
|
// error that comes in from the revoke API after that. This will
|
||||||
|
|||||||
3
changelog/20701.txt
Normal file
3
changelog/20701.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
```release-notes:bug
|
||||||
|
secrets/pki: Fix race during runUnifiedTransfer when deciding to skip re-running a test within a short window.
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user