Skip to content

Commit

Permalink
Fix leak of restore worker go routines after an error (#12933)
Browse files Browse the repository at this point in the history
  • Loading branch information
briankassouf authored Oct 27, 2021
1 parent 6a58268 commit 493a143
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vault/expiration.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,8 @@ func (m *ExpirationManager) Restore(errorFunc func()) (retErr error) {
broker := make(chan *lease)
quit := make(chan bool)
// Buffer these channels to prevent deadlocks
errs := make(chan error, len(existing))
result := make(chan struct{}, len(existing))
errs := make(chan error, leaseCount)
result := make(chan struct{}, leaseCount)

// Use a wait group
wg := &sync.WaitGroup{}
Expand Down

0 comments on commit 493a143

Please sign in to comment.