Skip to content

Stop mailbox-mail occupancy from flooding the send queue - #916

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-7739-latch-mailbox-mail-occupancy-so-a-worker-burst-cannot-fill
Sep 11, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-7739-latch-mailbox-mail-occupancy-so-a-worker-burst-cannot-fill

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Occupancy holds one in-flight mailbox-mail drive so store-subscribe, stall-poll, and idle-with-fleet settle cannot each call send and fill the depth-16 queue.
  • After a snapshot, those worker ids stay in-flight until take on success or release on failed send so a later flush can retry.
  • Wake copy says occupancy delivered the reports; it does not say already collected on first delivery.

Verification

  • bun run typecheck, bun run build, and bun run test pass
  • bun run check passes (6848 pass, 0 fail)

Fixes CL-7739
Fixes CL-7699

Overlapping occupancy flushes each called send before the parent was busy. Raising the depth-16 cap would only delay the same flood: occupancy already batches every uncollected terminal into one wake.
@linear-code

linear-code Bot commented Sep 11, 2026

Copy link
Copy Markdown

CL-7739

CL-7699

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Independent critic (CL-7739 + CL-7699)

Meets both tickets: occupancy holds one in-flight latchMailboxMailDrive; overlapping flushes do not double-send; a no-op does not latch; a new terminal can send after settle; sendQueueMax stays 16. Terminals are taken/latched before a second parent turn; failed send stays waitable; wake copy is occupancy-delivered, not “already collected”.

Blocking: none. Merge.

Should-fix (non-blocking): CHANGELOG puts the occupancy note under already-shipped ## [0.3.21]. This did not ship in 0.3.21. Move to a new [Unreleased] block.

Cannot GitHub-approve (same author). CI green.

@TheGreatAxios
TheGreatAxios merged commit ae96d35 into main Sep 11, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant