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
x/crypto/ssh: session.Close() should unblock session.Wait() #21699
Comments
can you provide more details under what circumstances the Close takes longer to process than the roundtrip that the RFC prescribes for channel close? I don't think we can trigger the channel close mechanics without receiving an ack from the remote side, as we wouldn't know where to deliver any messages, so it would lead to dropped data. |
ping. |
I don't follow. My issue is that a poorly implemented SSH server could potentially take forever to respond to a channel close which would cause session.Wait() to deadlock. |
the channel mechanism is not really suited for error handling/timeout, since both sides have to be in agreement on what to do with the channel. If the remote end can't do that, the proper course of action is shutdown the entire connection. |
That's fine with me, if the server doesn't respond in a reasonable amount of time to the channel close, we should just close the connection. |
have you seen this problem in practice? |
Nope. |
you can setup a keepalive. One does this by sending periodic requests (global or channel) with wantReply=true, and closing the connection if replies take too long. Maybe the SSH client should provide this out of the box, though? |
Nah, I think we're talking about different things. Even with SSH Keep Alive, a poorly implemented ssh server could take forever to respond to a channel close, which would cause session.Wait() to deadlock. It could handle other requests and respond to keep alive fine, just not respond to the channel close. |
Going to close as it has been a long time and I'm not sure if this is relevant anymore. |
The
session.Close
only sends the channel close message to the server. It's not until the server responds with a channel close message thatsession.Wait()
returns because of the reqs channel being closed.session.Wait()
should return immediately aftersession.Close()
.See #21423 for previous discussion.
The text was updated successfully, but these errors were encountered: