Skip to content

Commit

Permalink
feat: protect hc.subscibers behind mutex
Browse files Browse the repository at this point in the history
Signed-off-by: Manan Gupta <[email protected]>
  • Loading branch information
GuptaManan100 committed Jan 27, 2025
1 parent f82ffc4 commit 2b58d4c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go/vt/discovery/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,9 @@ func (hc *HealthCheckImpl) Subscribe() chan *TabletHealth {
} else {
// Message queue closed, so we should close the channel too.
close(c)
hc.subMu.Lock()
delete(hc.subscribers, c)
hc.subMu.Unlock()
return
}
}
Expand Down

0 comments on commit 2b58d4c

Please sign in to comment.