refactor(core): acknowledge single-threaded runtime shutdown - #301
Open
Parikalp-Bhardwaj wants to merge 3 commits into
Open
refactor(core): acknowledge single-threaded runtime shutdown#301Parikalp-Bhardwaj wants to merge 3 commits into
Parikalp-Bhardwaj wants to merge 3 commits into
Conversation
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Rust | Aug 10, 2026 8:00a.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the fixed 100ms delay in
SingleThreadedRuntime::stop()with explicitshutdown-completion acknowledgement from the runtime event loop.
stop()now relies on actual runtime lifecycle completion instead of anarbitrary sleep.
Closes #<ISSUE_NUMBER>
Problem
Previously,
SingleThreadedRuntime::stop()sentInternalEvent::Shutdownand then waited for a fixed 100ms:This did not guarantee that the runtime event loop had actually completed.
The event loop could:
stop()to return without confirming lifecycle completion.There was also a lifecycle edge case around
run()andstop()startingconcurrently that needed deterministic synchronization.
Changes
SingleThreadedRuntime::stop().stop()callers to observe already-completed shutdown state.stop()calls.stop()calls.stop()beforerun()without waiting indefinitely.run()/stop()startup race deterministically.after
stop().Shutdown Flow
Before:
Now:
Tests
Added/updated coverage for:
stop()calls;stop()calls;stop()beforerun();run()/stop()startup race;Compatibility
Runtimetrait.Related - #300
Greptile Summary
Replaces the runtime’s fixed shutdown delay with lifecycle-state synchronization and explicit completion acknowledgement.
run()/stop()startup race.Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Reviews (3): Last reviewed commit: "fix(core): guard shutdown completion dur..." | Re-trigger Greptile
Context used: