Repository navigation
fix(db): avoid coroutine leak in sync DSN resolver (#2325 to stage) - #2361
Conversation
|
Warning Review limit reachedNext included review available in 24 minutes. View limit detailsLimit details: You’ve used all 8 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
ChangesRocketRide DB resolution
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The synchronous resolver retains its expected behavior while avoiding coroutine creation when called from an active event loop. No actionable merge risk remains. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation For ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
🤖 Internal: Discord sync markerAuto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
asclearuc
left a comment
There was a problem hiding this comment.
Thanks @kgarg2468 — this is a clean fix. Deferring coroutine construction until after the running-loop pre-check is the right shape, and the rewritten test_rejects_running_event_loop_before_creating_coroutine proves the coroutine is never built rather than only that the call raises, which is the part that actually matters.
This is the byte-identical port of #2325 onto stage (I compared the two diffs; they match exactly), so the review below is the same one I left on #2325.
Note on CI: the three Build jobs were still running when I wrote this, so the review is against code whose build and test results are not in yet. Nothing is red.
Approve
One non-blocking should fix is inline: tool_filesystem has a second copy of _run_async with the same defect. CodeRabbit's Major on the missing regression docstring is addressed in 85ae5b78 and its thread is resolved; nothing outstanding there.
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@asclearuc this final head is the exact four-commit stage port of merged develop #2325. CodeRabbit is clean, CI is green, the focused filesystem/DSN regressions pass, and there are no unresolved threads. Please re-review the final head. |
"## Summary\n\n- port #2325 to the current stage release line\n- reject synchronous DSN and filesystem operations from an active event loop before constructing their coroutines\n- preserve the existing resolver and filesystem contracts while preventing unawaited-coroutine warnings\n- cover the duplicated filesystem helper so all ten call sites defer coroutine creation\n\n## Type\n\nfix (stage port)\n\n## Testing\n\n- [x] Tests added or updated\n- [ ]
./builder test:fast lint:check surfaces:checknot run locally; GitHub CI is the final repository-wide gate\n- [ ] Engine-dependent suites not run locally; focused engine-free pytest coverage passed\n\ntext\ntool_filesystem focused unit suites: 120 passed; hardened regression: 35 passed\nruff check + ruff format --check: passed\ndevelop/stage range-diff: all 4 commits equivalent\n\n\n## Checklist\n\n- [x] Commit messages follow conventional commits\n- [x] No secrets or credentials included\n- [x] Docs updated in the same change (not applicable; internal lifecycle behavior only)\n- [x] Breaking changes documented (not applicable; no breaking changes)\n\n## Agent context\n\nOpenAI Codex (gpt-5.6-sol) / T3 Code, autonomous under explicit approval. Focused tests and develop/stage patch parity were verified locally; engine-dependent builder suites remain delegated to GitHub CI.\n\n## Paired PR\n\nDevelop: #2325\n\n## Release Coordination\n\nMerge with the release owner so the SaaS engine pin advances in the same release window.\n\n## Linked Issue\n\nFixes #2318\n\n\n\n\n## Summary by CodeRabbit\n\n- Bug Fixes\n - Improved reliability for filesystem and database operations when called from applications that already have an active asynchronous event loop.\n - Prevented premature asynchronous operation creation in these scenarios, reducing runtime errors and resource warnings.\n - Added safeguards to ensure affected operations fail cleanly and predictably when used in unsupported event-loop contexts.\n\n\n"