Fix shutdown timeout handling in completion wait function by stelfrag · Pull Request #21395 · netdata/netdata

Conversation

@stelfrag

@stelfrag stelfrag commented

Dec 3, 2025

edited by cubic-dev-ai bot

Loading

Summary
  • Handle spurious wakeups when waiting for a completion

Summary by cubic

Fixed timed wait in completion to handle spurious wakeups and respect shutdown timeouts. Prevents premature timeouts or hanging during shutdown.

  • Bug Fixes
    • Use an absolute deadline and compute remaining timeout each loop.
    • Re-check completion after each wake to ignore spurious wakeups.
    • Enforce a minimum 1 ns timeout when zero is passed.

Written for commit 6a88f34. Summary will update automatically on new commits.

@stelfrag stelfrag marked this pull request as ready for review

December 3, 2025 14:25

cubic-dev-ai[bot]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

thiagoftsm

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found during shutdown. LGTM!

stelfrag added a commit to stelfrag/netdata that referenced this pull request

Dec 5, 2025
)

(cherry picked from commit edb587b)

Ferroin pushed a commit that referenced this pull request

Dec 15, 2025
(cherry picked from commit edb587b)

2 participants

@stelfrag @thiagoftsm