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:
Kristoffer Dalby 2026-04-17 05:51:34 +00:00
parent 0567cb6da3
commit 842f36225e
3 changed files with 52 additions and 16 deletions

View file

@ -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()