state: drain pending pings on Close
Blocked callers waiting on a pingTracker response channel would hang forever if the server Close()d mid-probe. Drain the pending map on Close so those goroutines unblock and exit cleanly. Updates #3157
This commit is contained in:
parent
0567cb6da3
commit
842f36225e
3 changed files with 52 additions and 16 deletions
|
|
@ -267,6 +267,7 @@ func NewState(cfg *types.Config) (*State, error) {
|
|||
|
||||
// Close gracefully shuts down the State instance and releases all resources.
|
||||
func (s *State) Close() error {
|
||||
s.pings.drain()
|
||||
s.nodeStore.Stop()
|
||||
|
||||
err := s.db.Close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue