Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
x/crypto/ssh: Race Conditions on Channel EOF, Closing and Request Processing #29733
What version of Go are you using (
Your analysis of the problem is spot on, but I am hesitant to rework the package in the way you suggest.
Mixing data and requests in a single queue is problematic because the former has control flow while the latter has not.
Maybe we could move all of request processing to a single routine, but it would be brainsurgery on the package. I doubt it could be done in a backward compatible way. To make things worse, it's easy to hang and deadlock the SSH mux if the user code (that processes the requests) would somehow send data or requests back to the other side.
I think your proxy always receives the exit-status, is that correct? If so, my suggestion is the following:
The flow you describe of using a timer started off of EOF is what we internally tested and shipped into our testing release channel yesterday, getting wider feedback from users is ongoing. I'm happy we at least have the same short term approach :-)
So far this approach seems to be working, but we are generally concerned under high load / parallelism we could still see "random" Ansible failures which are very painful to debug and reproduce.