Skip to content

fix(ssh-gateway): preserve runner exit status requests#5090

Open
cyq1017 wants to merge 1 commit into
daytonaio:mainfrom
cyq1017:codex/daytona-5027-ssh-exit-status
Open

fix(ssh-gateway): preserve runner exit status requests#5090
cyq1017 wants to merge 1 commit into
daytonaio:mainfrom
cyq1017:codex/daytona-5027-ssh-exit-status

Conversation

@cyq1017

@cyq1017 cyq1017 commented Jun 18, 2026

Copy link
Copy Markdown

Description

The SSH gateway can close the client channel before late runner channel
requests, such as exit-status, finish forwarding. When runner stdout/stderr
copy returns first, deferred channel closes can race with the request forwarder
and the client may miss the remote process exit status.

This change makes runner request forwarding waitable and waits for it during
channel teardown after runner output copy returns. The wait is bounded so a
stuck request stream cannot hang teardown forever.

Documentation

  • This change requires a documentation update
  • I have made corresponding changes to the documentation

Related Issue(s)

This PR addresses issue #5027

Screenshots

Not applicable.

Notes

Verification:

  • go test ./apps/ssh-gateway -count=1

Summary by cubic

Fixes apps/ssh-gateway dropping late runner exit-status by waiting for runner→client request forwarding to drain before closing the channel. Adds a bounded timeout to avoid hangs. Addresses #5027.

  • Bug Fixes
    • Make runner→client request forwarding waitable and wait during teardown; bounded by channelRequestDrainTimeout.
    • Extract forwardChannelRequests and copyRunnerToClient, and add tests to ensure exit-status arrives after runner EOF and that output copy waits until requests drain.

Written for commit 9e6fe0a. Summary will update on new commits.

Review in cubic

Signed-off-by: cyq <15000851237@163.com>
@cyq1017 cyq1017 force-pushed the codex/daytona-5027-ssh-exit-status branch from a957aa7 to 9e6fe0a Compare June 18, 2026 07:41
@cyq1017 cyq1017 marked this pull request as ready for review June 18, 2026 10:53

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@vedranjukic vedranjukic force-pushed the main branch 2 times, most recently from 2c15a7f to b40f732 Compare June 23, 2026 14:12
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