Skip to content

fix(poller): bound Stop wait so a slow SNMP tick cannot hang shutdown (#481) - #523

Merged
gnacho merged 1 commit into
mainfrom
fix/481-shutdown-snmp-timeout
Sep 4, 2026
Merged

gnacho merged 1 commit into
mainfrom
fix/481-shutdown-snmp-timeout

Conversation

@gnacho

@gnacho gnacho commented Sep 4, 2026

Copy link
Copy Markdown
Owner

When a poller tick is stuck on a slow/hung SNMP or SSH poll, Poller.Stop() waited on the in-flight tick forever, so the systemd stop hung until TimeoutStopSec killed the process.

Stop now waits at most 15s (stopWait) and logs that it gave up; main returns and the process exits with the stuck goroutine. The tick itself already terminates on its own thanks to the gosnmp timeout (5s + 1 retry), so bounded waiting never aborts a poll that would otherwise finish.

Includes two regression tests (blocking adapter): Stop returns promptly on a hung tick, and still waits for a tick that finishes.

@gnacho
gnacho merged commit 82f7b6e into main Sep 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant