Repository navigation
Conversation
spawn_push refused the entire pending queue whenever the *combined* framed size exceeded the platform argv limit, even when the head of the queue would fit. That left recipients stalled forever once the backlog grew past the budget. - drainForDelivery now accepts the same opts as drainQueue (canDeliver) - deliverViaSpawn drains every message that still fits (FIFO), leaving the rest pending for the next cycle - Only refuse delivery when the head message alone cannot fit; queue stays untouched and the operator is pointed at pull delivery - Rewrite P2-2 for head-oversized; add P2-2b for partial drain (issue CL-BAF#3)
|
Thanks for the PR. The overall approach looks right, but there are a few issues to fix before merge: The current canDeliver logic can skip a message that does not fit and then deliver a later smaller message, which breaks strict FIFO ordering. Once the first pending message does not fit, later messages should remain queued too. Once those are fixed, I’ll review it again. |
Once the first pending message does not fit, stop draining so a smaller later message cannot leapfrog. Measure argv costs with UTF-8 byteLength. Correct separator length for "\\n\\n---\\n\\n" (7). Add regression test.
|
Thanks — addressed the review notes:
Ready for another look. |
|
Thanks for following up and addressing the earlier review. I checked f5ed190; the FIFO change now behaves correctly, and all 20 spawn-delivery tests pass. There are still a few things to address before merge:
After updating, please rerun the typecheck and the spawn-delivery, engine, delivery-budgets, and linked-delivery-cleanup tests. Thanks again for working on this. Once those points are addressed, I’ll take another look. |
Merge upstream main. Charge JOIN only between framed messages; refuse oversized head without draining. Channel lifetime budget is checked before argv canDeliver so exhausted channels cannot block other mail. Strengthen P2-2b-strict to assert payload and exact remaining queue ids.
|
Thanks for the detailed follow-up — addressed on the latest push:
Also merged current Ready for another look when you have a moment. |
Summary
Fixes #3 —
spawn_pushdelivery stalled once the pending queue’s combined framed size exceeded the platform argv budget, even when the head of the queue would fit.Behavior
Implementation
drainForDelivery(state, id, opts?)— passcanDeliverthrough todrainQueue(already supported).deliverViaSpawn— running byte budget viacanDeliver; head-only oversized still refuses without draining.Tests