Skip to content

Commit

Permalink
backport of commit b81a94b
Browse files Browse the repository at this point in the history
  • Loading branch information
cipherboy committed May 4, 2023
1 parent 920f3c7 commit 7bef724
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions vault/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ type RollbackManager struct {
inflight map[string]*rollbackState
inflightLock sync.RWMutex

doneCh chan struct{}
shutdown bool
shutdownCh chan struct{}
shutdownLock sync.Mutex
stopTicker chan struct{}
quitContext context.Context
doneCh chan struct{}
shutdown bool
shutdownCh chan struct{}
shutdownLock sync.Mutex
stopTicker chan struct{}
tickerIsStopped bool
quitContext context.Context

core *Core
}
Expand Down Expand Up @@ -100,7 +101,10 @@ func (m *RollbackManager) Stop() {
//
// THIS SHOULD ONLY BE CALLED FROM TEST HELPERS.
func (m *RollbackManager) StopTicker() {
close(m.stopTicker)
if !m.tickerIsStopped {
close(m.stopTicker)
m.tickerIsStopped = true
}
}

// run is a long running routine to periodically invoke rollback
Expand Down

0 comments on commit 7bef724

Please sign in to comment.