DO NOT MERGE: serverless restart race condition#4997
Conversation
|
🚅 Deployed to the rivet-pr-4997 environment in rivet-frontend
|
PR Review: DO NOT MERGE — Serverless Restart Race ConditionPR #4997 | Draft | +2075 / -0 lines | Author: @NathanFlurry OverviewThis is a diagnostic/investigation PR — no fix is shipped. It adds a self-contained test harness to reproduce and characterize a post-engine-restart race condition in which gateway traffic to already-warmed serverless actors hangs for ~0-3 seconds after the engine's Three files added:
The investigation correctly identifies that the bug is not SQLite-specific: the same hang occurs with KV heartbeats and no heartbeats. The root cause is gateway/serverless routing state for existing actors not settling immediately after engine health returns. What Works Well
Issues1. Inconsistent indentation in the runtime fixture (cosmetic)
2. ROLLBACK error is silently swallowed in
3. WebSocket error event discards the underlying error The 4. Investigation doc references local Lines 229-244 of the 5. Investigation doc belongs in Per CLAUDE.md, all agent working files live in 6. The function waits a full 7. When the timeout fires and rejects, the original promise continues running in the background. This can produce confusing runtime output where the harness has already reported "timed out" but a delayed response still logs. Worth tracking if this harness evolves into a real gate test. Minor Style Notes
SummaryThis is solid diagnostic work. The race condition is well-characterized, the methodology is reproducible, and the conclusion (engine |
aa455c7 to
154af5d
Compare
7d0b73c to
d754df5
Compare
154af5d to
011798b
Compare
011798b to
673ed87
Compare
d754df5 to
72cbc7c
Compare
673ed87 to
e1d5a39
Compare
e1d5a39 to
aeb5da6
Compare
aeb5da6 to
e960beb
Compare
a20fe59 to
e344619
Compare
e960beb to
f573f80
Compare

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: