-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ssh-gateway] fix missing output when running simple command #18366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@iQQBot there is the actual fix? in the library? |
![]() Move close to another place, it's because golang routine competition, we need send all date before we call close. |
/hold maybe we should wait all of stdout, stderr, request then call close |
ok, I tried with VS Code Desktop and Local SSH over direct SSH, it does not help there, it now fails differently though, it seems it can tunnel, but then interrupts, before could not forward at all.
|
Yeah, It's another problem, not related this PR |
What interesting though that before it won't ever reach |
@iQQBot Good to retest? |
defer wg.Done() | ||
_, _ = io.Copy(targetChan, originChan) | ||
targetChannelWg.Done() | ||
targetChannelWg.Wait() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder should not we wait for stderr/stdout in both directions? won't close on one end trigger close on another
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, they are closed together. It's just that due to the nature of go routines, it is possible that the last few bytes may not be guaranteed to be sent completely, so we need to wait for all of them to be sent before sending a close signal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I meant there we can simplify with one wg, which waits for both directions, but like that is fine as well 👍
@iQQBot preview envs are down? |
Rerun |
@akosyakov Found bug in https://github.com/microsoft/dev-tunnels-ssh that it omit Which should make local-ssh x gateway works |
@mustard-mh I checked it is the same with the tunnel but it works. I wonder whether maybe it works with all changes together now. Although if we resolved localhost hanging then exploring direct SSH is not a priority. |
@akosyakov It's because golang lib doesn't ignore When we use local-ssh x gateway, dev-tunnel will send So we can fix it in golang-crypto or dev-tunnel |
/unhold |
Description
This PR fixes missing output in SSH gateway when running a simple command, and also upgrade golang crypto library
Summary generated by Copilot
🤖 Generated by Copilot at e9c1f91
Fixed security and compatibility issues in
ws-proxy
component. Refactored SSH proxy forwarding code to prevent crashes and handle errors better.Related Issue(s)
Fixes EXP-246
How to test
watch -n 0.1 ssh -T 'workspaceID#[email protected]' 'date +%s%N'
test for 1minuteDocumentation
Preview status
Gitpod was successfully deployed to your preview environment.
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
/hold