Skip to content

TEMP mailbox reconnect trace on main (do not merge) - #894

Closed
yansfil wants to merge 4 commits into
mainfrom
temp/mailbox-trace-main
Closed

yansfil wants to merge 4 commits into
mainfrom
temp/mailbox-trace-main

Conversation

@yansfil

@yansfil yansfil commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Temporary evidence run for the remote mailbox reconnect failure after #892: runs only the remote mailbox lane, repeats one test four times, keeps every run directory, and logs the session-sync coordinator. Will be closed without merging.

…ent away and came back

A ring that failed with a Herdr call waited for the pane to move, since the
bell might have been typed. When the failure came from the device's link
dropping, the pane came back idle at the same state sequence, never moved,
and the letter was never rung again. Losing the link now ends that wait.
@yansfil yansfil closed this Oct 9, 2026
yansfil added a commit that referenced this pull request Oct 9, 2026
Related: #892 (main turned red in the remote mailbox lane after it
merged)

## Summary

-
`remote_delivery::connected_remote_panes_receive_once_and_disconnect_keeps_the_same_letter_pending`
timed out waiting for the bell of the letter sent just before the device
disconnects.
- Cause: the doorbell tried that letter in the moment the SSH link
dropped, the Herdr call failed, and a failed ring waits for the pane to
move (the bell might have been typed). The device came back with the
pane idle at the same state sequence, so it never moved and the letter
was never rung again.
- Fix: when the pane or its device's link goes away after a failed ring
(`pane_unavailable`), that wait ends, and the letter is tried again once
the link is back. A bell that had started a turn would have moved the
pane, so this cannot type a second bell into a turn the first one
started.
- #892 did not add the bug; it changed timing so the doorbell now
reaches that letter before the disconnect more often (traced below).

## Review

- **조심해서 볼 파일**: `herdr-core/src/delivery/doorbell.rs` - failure path of
the bell: when a failed ring may be retried decides whether a bell can
be typed twice.
- **질문**: is "the link went away and came back with the pane unmoved" a
safe enough signal that the first bell never landed, or should the retry
also require a new state sequence from Herdr?

## Evidence

- **확인한 것**: a new doorbell test drives the fake Herdr through a ring
that fails as the link drops, the link going away (`pane_unavailable`),
and the link coming back: with the fix the letter is rung once; with
`link_lost` disabled nothing is typed (the CI symptom). herdr-core and
hided: 2302 tests pass.
- **확인한 것**: TEMP trace runs (#894 on main, #895 on the commit before
#892, coordinator and doorbell logged, every run directory kept):
pre-#892 4/4 passed with no `doorbell.failed`; main 3/4, and the one
failure is the only run with `doorbell.failed herdr_call_failed` for
that letter, after which the reconnected coordinator connected and
published but the letter was never tried again.
- **확인한 것**: the remote mailbox test passed 6/6 locally on macOS before
the fix (the race needs the CI runner's timing).
- **확인하지 못한 것**: why #892 moved the doorbell's first look at the letter
earlier was not isolated; the fix removes the dependency on that timing.
The eight-repeat TEMP run with this fix is linked in a comment when it
finishes.
@yansfil
yansfil deleted the temp/mailbox-trace-main branch October 19, 2026 06:51
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