Skip to content

fix(relay): no pooled-flusher wake for below-threshold records during an in-flight POST - #11034

Merged
lawrencecchen merged 1 commit into
mainfrom
fix-journal-pool-wake
Aug 28, 2026
Merged

lawrencecchen merged 1 commit into
mainfrom
fix-journal-pool-wake

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Unbreak main: journal_forwarder::tests::pooled_threshold_drains_an_exact_batch_and_defers_while_posting fails deterministically on main (Linux + macOS) since #10989 merged — first surfaced by the feat-relay-tunnel-terminal gate (run 33135003977), reproduced on a main-pinned probe branch (verify-main-journal-pool).

#10989 replaced the typed FlushWake::Arm/Batch channel with one coalesced Notify, and the below-threshold arm lost its distinction: during an in-flight POST every sub-threshold enqueue now stores a wake permit, which the PR's own deferral pin forbids. Fix: skip the wake while pool.flushing — the POST completion path already re-arms the debounce for leftover pending records under the same lock that clears flushing (flush_cycle), so nothing waits and nothing is lost.

Hosted --filter pooled_threshold dispatch on this branch is the gate evidence.


Summary by cubic

Fixes the pooled flusher wake in journal_forwarder so below-threshold records no longer store a spurious permit during an in-flight POST. The POST completion path already re-arms the debounce for leftover pending records, so the extra wake was causing a deterministic test failure on main since #10989.

Written for commit 6364b3f. Summary will update on new commits.

Review in cubic

… during an in-flight POST

#10989's Notify port dropped the flushing guard on the below-threshold
arm: every sub-threshold enqueue during a POST stored a wake permit,
which the PR's own deferral pin
(pooled_threshold_drains_an_exact_batch_and_defers_while_posting)
forbids — cargo test fails deterministically on main since the merge.
The POST's completion already re-arms the debounce for leftover pending
records under the same lock that clears `flushing`, so the wake was
spurious, not load-bearing. No lost records: enqueue-under-flushing and
completion serialize on the pool lock.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 24 minutes.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d82830fb-49de-4142-97e2-eeaa385756db

📥 Commits

Reviewing files that changed from the base of the PR and between f8eb151 and 6364b3f.

📒 Files selected for processing (1)
  • cmux-tui/crates/chatmux-relay/src/journal_forwarder.rs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lawrencecchen
lawrencecchen merged commit 12d33df into main Aug 28, 2026
40 checks passed
rustybret pushed a commit to rustybret/bmux that referenced this pull request Aug 28, 2026
05544d5 fix(cmux-tui): terminal.close retires an exited terminal receipt without a live runtime (manaflow-ai#11036)
0ba31a2 fix(cmux-tui): bound the remote-connect handshake with a deadline (manaflow-ai#11030)
ae9e41d Cloud machines by kind: New Machine sheet, kind-based image resolution, and real workspace/terminal verbs in the cloud tree (manaflow-ai#10948)
12d33df fix(relay): don't wake the pooled flusher for below-threshold records during an in-flight POST (manaflow-ai#11034)
44d9eb5 otel: keep all Cloud VM traces, head-sample everything else at 2% (manaflow-ai#11032)
lawrencecchen added a commit that referenced this pull request Aug 28, 2026
…rral rule

pooled_arm_wakes_are_coalesced_while_the_flusher_is_busy and the
pooled_threshold deferral pin demanded opposite wake behavior for the
same state (flushing=true, zero stored permits, below-threshold
enqueues): one required a wake, the other forbade it. They were never
green together — #10989 and #11034 each gated with a filter that
selected only one of them. The code semantics are the #11034 rule
(completion re-arms; a wake during a POST is spurious), so this pin
moves to that rule: arms defer while flushing, then wake and coalesce
once the flusher is idle.

(cherry picked from commit e92bc95)
lawrencecchen added a commit that referenced this pull request Aug 28, 2026
…rral rule (#11038)

pooled_arm_wakes_are_coalesced_while_the_flusher_is_busy and the
pooled_threshold deferral pin demanded opposite wake behavior for the
same state (flushing=true, zero stored permits, below-threshold
enqueues): one required a wake, the other forbade it. They were never
green together — #10989 and #11034 each gated with a filter that
selected only one of them. The code semantics are the #11034 rule
(completion re-arms; a wake during a POST is spurious), so this pin
moves to that rule: arms defer while flushing, then wake and coalesce
once the flusher is idle.
lawrencecchen added a commit that referenced this pull request Aug 28, 2026
…ach (#11017)

* chatmux-relay: tunnel-direct terminal listener + transport-fenced detach

Port of chatmux packages/relay/bin/tunnel-terminal.mjs: a loopback TCP
listener (127.0.0.1:9776, managed sandboxes only) serving terminals
through the shared PtyManager with u32be+kind framing, poisoned-decoder
close, open/resize/detach control frames, and the Worker's error-code
map. Managed relays start it best-effort from stay_online.

The shared manager grows transport fencing (Node 0.0.14 parity): every
attachment records the transport that opened it, foreign transports
cannot write/resize/flow/close it, and a dropped relay socket now
detaches only its own attachments via detach_transport — a Worker
deploy reconnect can no longer kill tunnel-attached terminals.
detach_all also cancels in-flight opens, closing a late-install race.

* chatmux-relay: cap the tunnel writer's final flush (stuck-peer reap)

* chatmux-relay: hosted-gate fixes — writer mutability + rustfmt

* chatmux-relay: derive Debug+PartialEq on TunnelFrame for the decoder pins

* fix(relay): don't wake the pooled flusher for below-threshold records during an in-flight POST

#10989's Notify port dropped the flushing guard on the below-threshold
arm: every sub-threshold enqueue during a POST stored a wake permit,
which the PR's own deferral pin
(pooled_threshold_drains_an_exact_batch_and_defers_while_posting)
forbids — cargo test fails deterministically on main since the merge.
The POST's completion already re-arms the debounce for leftover pending
records under the same lock that clears `flushing`, so the wake was
spurious, not load-bearing. No lost records: enqueue-under-flushing and
completion serialize on the pool lock.

(cherry picked from commit 6364b3f)

* test(relay): align the pooled arm-coalescing pin with the #11034 deferral rule

pooled_arm_wakes_are_coalesced_while_the_flusher_is_busy and the
pooled_threshold deferral pin demanded opposite wake behavior for the
same state (flushing=true, zero stored permits, below-threshold
enqueues): one required a wake, the other forbade it. They were never
green together — #10989 and #11034 each gated with a filter that
selected only one of them. The code semantics are the #11034 rule
(completion re-arms; a wake during a POST is spurious), so this pin
moves to that rule: arms defer while flushing, then wake and coalesce
once the flusher is idle.

(cherry picked from commit e92bc95)
rustybret pushed a commit to rustybret/bmux that referenced this pull request Aug 28, 2026
6964584 iOS: show first-run onboarding only after sign-in (manaflow-ai#10789)
c582b8d perf(cmux-tui): replay durable notices without a temporary vec (manaflow-ai#11026)
cc47a91 fix(cmux-tui): stop terminal content admission from swallowing context-menu presses (manaflow-ai#11019)
9578c8a chatmux-relay: tunnel-direct terminal listener + transport-fenced detach (manaflow-ai#11017)
9ae6367 test(relay): align the pooled arm-coalescing pin with the manaflow-ai#11034 deferral rule (manaflow-ai#11038)
3be7b61 iOS: give the changes-hint banner dismiss button a 44pt hit target (manaflow-ai#10883)
lawrencecchen added a commit that referenced this pull request Aug 28, 2026
… during an in-flight POST (#11034)

#10989's Notify port dropped the flushing guard on the below-threshold
arm: every sub-threshold enqueue during a POST stored a wake permit,
which the PR's own deferral pin
(pooled_threshold_drains_an_exact_batch_and_defers_while_posting)
forbids — cargo test fails deterministically on main since the merge.
The POST's completion already re-arms the debounce for leftover pending
records under the same lock that clears `flushing`, so the wake was
spurious, not load-bearing. No lost records: enqueue-under-flushing and
completion serialize on the pool lock.
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