Skip to content

Commit

Permalink
bug: prevent go routine leakage due to existing DeferCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
huikang committed Aug 22, 2023
1 parent 5b88aae commit 06d4c72
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions agent/local/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,12 @@ func (l *State) setCheckStateLocked(c *CheckState) {
existing := l.checks[id]
if existing != nil {
c.InSync = c.Check.IsSame(existing.Check)
// If the existing check has a Defercheck, it needs to be
// assigned to the new check
if existing.DeferCheck != nil && c.DeferCheck == nil {
c.DeferCheck = existing.DeferCheck
c.InSync = false
}
}

l.checks[id] = c
Expand Down

0 comments on commit 06d4c72

Please sign in to comment.