Skip to content

fix: don't block StatusMessageWatcher exit with 6s sleep on exception#753

Merged
vdusek merged 1 commit intomasterfrom
fix/status-message-watcher-sleep
Apr 22, 2026
Merged

fix: don't block StatusMessageWatcher exit with 6s sleep on exception#753
vdusek merged 1 commit intomasterfrom
fix/status-message-watcher-sleep

Conversation

@vdusek
Copy link
Copy Markdown
Contributor

@vdusek vdusek commented Apr 22, 2026

Summary

StatusMessageWatcher sleeps 6 seconds on exit to let the final status/status-message propagate. Two issues with the current placement:

  • API asymmetry: the sync stop() does the sleep itself, while the async twin does it in __aexit__. So manual sync stop() paid the 6s even though manual await stop() did not.
  • Exceptional exits were delayed: both __exit__ and __aexit__ ignored the exc_type they receive, so a Ctrl+C or any exception bubbling out of with/async with was held up 6 seconds.

This change:

  • Moves time.sleep(self._final_sleep_time_s) out of sync stop() into __exit__ (matches async shape).
  • Gates the sleep in both __exit__ and __aexit__ on exc_type is None so exceptional exits propagate immediately.

Normal-exit behavior (the final-message capture window) is preserved.

Move the final sleep out of sync `stop()` into `__exit__` so manual stop
doesn't pay it (matching the async API shape), and gate the sleep in both
`__exit__` and `__aexit__` on `exc_type is None` so exceptional exits (e.g.
Ctrl+C) propagate immediately instead of waiting 6 seconds.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Apr 22, 2026
@vdusek vdusek self-assigned this Apr 22, 2026
@github-actions github-actions Bot added this to the 139th sprint - Tooling team milestone Apr 22, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Apr 22, 2026
@vdusek vdusek requested a review from Pijukatel April 22, 2026 07:52
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.24%. Comparing base (6b8001e) to head (aa6aa40).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #753      +/-   ##
==========================================
- Coverage   95.45%   95.24%   -0.22%     
==========================================
  Files          45       45              
  Lines        5125     5127       +2     
==========================================
- Hits         4892     4883       -9     
- Misses        233      244      +11     
Flag Coverage Δ
integration 95.24% <100.00%> (-0.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek merged commit 48f5037 into master Apr 22, 2026
25 of 26 checks passed
@vdusek vdusek deleted the fix/status-message-watcher-sleep branch April 22, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants