chore(rivetkit): rewrite work registry + fix waituntil not preventing sleep#4990
Conversation
|
🚅 Deployed to the rivet-pr-4990 environment in rivet-frontend
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Code ReviewOverviewThis PR does two things in one: it fixes a real bug (waitUntil work registered inside CorrectnessDead code in the teardown loop ( abortable_shutdown_tasks.0.shutdown().await;
// This loop is unreachable — shutdown() already drains the JoinSet
while let Some(result) = abortable_shutdown_tasks.0.join_next().await {
...
}
let deadline = Instant::now() + Duration::from_secs(60 * 60 * 24 * 365);The intent is "wait forever, but cancel via Return value of The function returns await runtime.actorWaitForTrackedShutdownWork(ctx);Either document that callers are expected to ignore the value, or switch to
The local variable returned from the lock-swap block is let (mut abortable, mut unabortable) = { ... };TOCTOU in native The Design
Test CoverageThe new One thing to check: Minor style
SummaryThe refactor is architecturally sound and the bug fix is correct. The two actionable items before merge are:
Everything else is polish. |

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: