Skip to content

fix(bin): keep remote reply listener alive across SSH transport failures - #7860

Closed
mehulbhagwani wants to merge 3 commits into
kunchenguid:mainfrom
mehulbhagwani:fm/fm-remote-reply-transport-error
Closed

mehulbhagwani wants to merge 3 commits into
kunchenguid:mainfrom
mehulbhagwani:fm/fm-remote-reply-transport-error

Conversation

@mehulbhagwani

@mehulbhagwani mehulbhagwani commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Treat SSH transport failures and non-schema remote output as transient empty windows.
  • Keep the remote-reply listener alive without advancing the cursor or ingesting invalid bytes.
  • Preserve continuity-break escalation.
  • Add regression coverage for SSH exit 255, Windows-shaped timeout diagnostics, relistening, and staged-output cleanup.

Validation

  • Focused remote-reply regression suite passes.
  • Lint passes.
  • The regression reproduces before the fix and passes with the fix.
  • The unrelated process-event suite failure also occurs on the base branch because setsid is unavailable in this environment.

CI

The portable serial check was cancelled without a verdict, matching the base branch behavior. All other reported checks passed. A rerun was requested from the repository maintainers.

Fixes #7857

@mehulbhagwani

Copy link
Copy Markdown
Contributor Author

Behavior portable serial 1 was cancelled without a verdict, matching the current upstream main behavior. Please rerun that shard on Kun’s side.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @mehulbhagwani. This is a careful fix, and the regression coverage (exit 255, the Windows-shaped diagnostic, staged-output cleanup on TERM) is exactly what I'd want here.

What I checked on head 9de855b0 against main 7da4c362:

  • Continuity breaks still escalate. fm-remote-delta-read.sh emits status=continuity-broken with exit 0, so the new branch never touches it. Non-schema bytes are never forwarded, and the cursor doesn't move. Good.
  • Contract: main's tests/fm-remote-reply.test.sh specifies that "a failed remote read exits instead of relistening" (fix: keep remote reply listeners and watcher cycles running #5941). This PR rewrites that test so that every non-zero leg relistens under the same claim. That includes exit 1 or 2 from the remote reader, not just ssh 255. Dropping the malformed capture restores what was promised. Turning exit-on-failure into relisten-on-failure replaces a specified default, so I'm classing this new-default. That makes it a captain decision once it's otherwise ready, not something I merge on my own. You don't need to change anything for that.
  • One question I'd like your take on: with this change, a persistent failure (revoked key, host gone for good) relistens quietly at the launch floor. Is staleness in remote channel freshness what eventually surfaces that to the captain, since a failed leg no longer counts as caught up? A sentence in the PR body would help the captain decide.

Two things are still open, and this one is waiting on you:

  1. no-mistakes: the "PR must be raised via no-mistakes" check failed after the 17:53Z body edit, because the body no longer has the ## Pipeline section and its attestation. Could you restore that section, or re-raise with git push no-mistakes, so the attestation binds 9de855b0?
  2. Live check (optional but very welcome): the incident was on a real Windows/WSL host. If you can reproduce one transport drop there and show the listener staying armed, with no malformed capture, please post that here.

The "Behavior portable serial 1" cancel is the same 30-minute shard cancel main has right now, not your change. I've requested a rerun of the failed job on run 40549482323.

contract-class: new-default (relisten on failed transport replaces the specified exit-on-failure rule).

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @mehulbhagwani, this is a useful fix. Would you be open to splitting it into two PRs? The part that stops a malformed capture from wedging the listener (#7857) is a straight fix, and on its own it could merge automatically once it's green. The part that keeps relistening after a failed SSH transport (and after a remote exit 1/2) changes the behavior #5941 specified, where a failed read exits instead of relistening, so that half needs Kun's decision. Splitting them lets the fix land without waiting on that decision. For each PR, a no-mistakes raise on its final head (or restoring the ## Pipeline section in this body) is what our required check looks for. No rush, and thanks again.

@mehulbhagwani

Copy link
Copy Markdown
Contributor Author

The work is split as requested: straight #7857 safety fix in #7874, and the separate #5941 relisten behavior in #7887.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @mehulbhagwani for splitting this up so quickly. I've checked both halves: the #7857 safety fix is in #7874, and the #5941 relisten change is in #7887. Together they cover everything on this head (9de855b0), so review continues on those two PRs and nothing more is needed here. If you're happy with that, feel free to close this one. I'll leave it open in the meantime so nothing is lost.

@mehulbhagwani

Copy link
Copy Markdown
Contributor Author

Thanks for checking both halves. Closing this one: the #7857 safety fix landed in #7874, and the #5941 relisten behavior continues in #7887.

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.

Remote reply source stops after an SSH transport error is captured as a malformed result

2 participants