Repository navigation
Finish an upload's commit on its own task when the client leaves after its last byte, instead of parking it unpolled in the store's write queue - #3044
Conversation
…r its last byte, instead of parking it unpolled in the store's write queue
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
The fix is right for the stall it targets, and I checked the new test fails without it. But the new branch in |
|
Moving this to request changes for the panic at line 472. Under load with the slow store paused for 2 minutes, this branch logged 36 |
…t, and bound the background commit
…commit for the resume
What and why
A ByteStream client that leaves after its last byte leaves its upload parked, with the store update unpolled, until the sweeper drops it. A filesystem store waits for a
max_concurrent_writespermit at exactly that point. The parked waiter keeps its place in the queue and holds the permit it gets until swept. Enough of those and no upload commits; a production CAS had 98% of writes over 60 s until a restart.After the last byte, a dropped handler now hands the commit to its own task, bounded at 15 minutes, and parks a future that waits for it. A store update that already returned is never polled again: a commit stays parked as its result for a resume, a failure is dropped.
How was this verified?
New tests cover the abandoned commit, a store failing after EOF, a retry that sees the commit finish and then disconnects, and a resume at the full size. All but the last fail without the change. On a test cluster with one write permit and 32 clients abandoning uploads, a fresh upload took 90 s before and 1.8 s after.
Risk
Low. Partial uploads park and resume as before.
AI assistance
An agent drafted the change and I reviewed every line.