Uh oh!
There was an error while loading. Please reload this page.
fix(run-store): stop run-create failing on a brief write stall - #4514
Conversation
|
WalkthroughThe run store now accepts transaction options and defines a 15-second write timeout. Dedicated 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 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 |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
ee4f7c2 to
975ed18CompareNote GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
On the run-ops store, a run create with no associated waitpoint was wrapped in an interactive transaction whose default 5s budget is wall-clock from BEGIN, so a brief write stall could expire it and throw before the create ran, losing the run. Single-write creates now run as an implicit transaction with no app-held budget; the triggerAndWait path (run plus associated waitpoint) keeps an interactive transaction with headroom.
975ed18 to
075c12bCompareNote GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
On the run-ops store, creating a run could intermittently fail with a "Transaction already closed" error, and the run would never be created. Single-write run creates no longer run inside an interactive transaction, so a brief database write stall can't blow the transaction budget and drop the run.
Fix
The dedicated run-ops
createRun/createFailedRunwrapped a single nestedtaskRun.createin an interactive$transaction. Its default 5s budget is wall-clock fromBEGIN, so when a write briefly stalls the transaction expires before the create completes and throws, even though the statement itself is fast at the database.A single-write create does not need an interactive transaction: Prisma's implicit nested create is already atomic and holds no app-side budget, so it now runs directly. Only the
triggerAndWaitpath (run plus its associated waitpoint, two writes that must commit together) keeps an interactive transaction, now with headroom over the default.Verified with a red/green test against the real split topology (reproduces the exact expiry on the unchanged code, green after) and an end-to-end run created and completed through the dedicated store.