Skip to content

Commit

Permalink
fix: clear stack watchers map when lost leader lease
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Oct 15, 2024
1 parent 37dca26 commit 3be7e7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/applier/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ func (m *Manager) runWatchers(ctx context.Context) error {
m.removeStack(ctx, event.Name)
}
case <-ctx.Done():
// When the parent context is canceled, the stacks goroutine will stop.
// We need to clear the stacks map so that they can be added back if the lease is
// re-acquired.
m.stacks = make(map[string]stack)
log.Info("manifest watcher done")
return nil
}
Expand Down

0 comments on commit 3be7e7c

Please sign in to comment.