Skip to content

Fix: event-driven drain in session-timeout HUNG handler - #1636

Merged
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:fix-session-drain
Aug 2, 2026
Merged

Fix: event-driven drain in session-timeout HUNG handler#1636
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:fix-session-drain

Conversation

@ChaoWao

@ChaoWao ChaoWao commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

The handler slept a fixed 2 s after SIGUSR1 before printing the HUNG group and SIGTERMing the children. On a loaded runner (the cpu lane runs 5 jobs in parallel on one box) a starved descendant can take longer than 2 s to run its faulthandler dump — the dump then dies with the SIGTERM and the HUNG body lacks the frames that caused the hang (_grandchild_deadlock_sentinel missing).\n\nDrain until the pump's output stops growing (bounded at 10 s, quiet-detected at ~1 s of no new output), so slow signal delivery still lands in the group; children are SIGTERMed only once the output has settled.\n\nRationale: this is the same fixed-budget-vs-slow-process pattern as the session-timeout test's 3 s — event-driven instead of constant-tuning. Locally the race-free test passes in every configuration (3.9/3.10, full suite, under multi-process load ×20); this change hardens the production handler against the one unreproducible-locally case (real 5-job load on the runner).

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@ChaoWao, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 10 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 27201996-1040-4903-9953-05f1168d077e

📥 Commits

Reviewing files that changed from the base of the PR and between f0e5cba and efac8bf.

📒 Files selected for processing (1)
  • conftest.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The handler slept a fixed 2 s after SIGUSR1 before printing the HUNG
group and SIGTERMing the children. On a loaded runner a starved
descendant can take longer than 2 s to run its faulthandler dump, so
the dump is cut off by the SIGTERM and the HUNG body lacks the frames
that caused the hang. Drain until the pump's output stops growing
(bounded at 10 s, quiet-detected at ~1 s) so slow signal delivery still
lands in the group; the child is only SIGTERMed once the output has
settled.
@ChaoWao
ChaoWao merged commit 266b123 into hw-native-sys:main Aug 2, 2026
18 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