server: report WebRTC cleanup failures - #925
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 616c69a0a3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| completed = await _await_with_hard_timeout(cleanup, timeout_s=timeout_s) | ||
| results = cleanup.result() if completed else None |
There was a problem hiding this comment.
Report forced-finalizer failures that settle after the timeout
When a forced finalizer resists or defers cancellation past timeout_s and later raises, _await_with_hard_timeout returns False, this assigns None, and _report_cleanup_results is permanently skipped. The task remains scope-owned, but RuntimeTaskScope._on_done logs failures only at DEBUG, so the genuine cleanup failure this change intends to expose is still absent from normal production logs; attach the error-reporting policy to late task completion as well.
Useful? React with 👍 / 👎.
cd7a696 to
6419d39
Compare
616c69a to
fe99c25
Compare
Problem
WebRTC route shutdown spawned forced per-session finalizers with raw
asyncio.create_task()and discarded everygather(return_exceptions=True)result. Expected cancellation of peer-close waiters and genuine forced-finalizer failures were indistinguishable, so teardown defects could disappear silently.Changes
RuntimeTaskScopeCancelledErrorfrom cleanup waiters explicitly cancelled by shutdownWhy / impact
Normal teardown cancellation stays quiet, while a real cleanup failure is now observable as
easycat-webrtc-force-cleanup-<key>. The result policy no longer hides broken Session/capacity finalization.Root cause
The original shutdown code used
return_exceptions=Truesolely to keep one cleanup failure from short-circuiting siblings, but never inspected the returned exception values.Checks
webrtc_routes.py— passed