fix(ssh-gateway): preserve runner exit status requests#5090
Open
cyq1017 wants to merge 1 commit into
Open
Conversation
Signed-off-by: cyq <15000851237@163.com>
a957aa7 to
9e6fe0a
Compare
2c15a7f to
b40f732
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The SSH gateway can close the client channel before late runner channel
requests, such as
exit-status, finish forwarding. When runner stdout/stderrcopy 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
Related Issue(s)
This PR addresses issue #5027
Screenshots
Not applicable.
Notes
Verification:
go test ./apps/ssh-gateway -count=1Summary by cubic
Fixes
apps/ssh-gatewaydropping late runnerexit-statusby waiting for runner→client request forwarding to drain before closing the channel. Adds a bounded timeout to avoid hangs. Addresses #5027.channelRequestDrainTimeout.forwardChannelRequestsandcopyRunnerToClient, and add tests to ensureexit-statusarrives after runner EOF and that output copy waits until requests drain.Written for commit 9e6fe0a. Summary will update on new commits.