-
Notifications
You must be signed in to change notification settings - Fork 3
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
Race condition with many SSH channels open, unhelpful errors #2
Comments
Hi @sbrl, I will test it with 3-4 parallel executions later. I also will track down the error, error message building and the origin error from the ssh2-library. Can you meanwhile confirm that this is not a ssh2-library bug? I mean by checking their issues and check it with their callback function. |
Hi, I have added a concurrent multihost test file. 37b5098 The e2e execution tests are defined at the end of the e2e-concurrent-exec.test.ts file. If you know how to reproduce this error, please reply immediately. (UPDATE): cya 👍🏻 |
No response = no issue? :D |
Heya, Sorry, I have been rather busy. My codebase is pretty complicated, so it's difficult to track down the bug. That's unfortunate that you have not been able to track it down on your end. I'll give it another go on my end when I next get around to touching this codebase to see if I can isolate a minimum working example. |
Hii @sbrl , I guess i tracked down the issue as i said 3 weeks ago. |
Hello,
I am developing an application in which I need to make a very large number of concurrent SSH connections at once (regularly 180+ individual connections is the end goal), but I am having difficulty scaling my application.
Whenever I run it with just ~2 connections at once, it runs fine. However, if I run it with more than 2-3 connections at once with concurrent async interaction between multiple connections, I get crashes like this one:
.....but it fails to tell me what the error is, and I given that there is a stack break I cannot tell which connection has the problem or which call to a
hivessh
method actually had the problem.This error is randomly thrown at random points across my entire codebase, making debugging impactical. In esssence, I'm doing something like this (greatly simplified):
....just with lots of
.exec
calls.Empirical evidence suggests that this is a bug with
.exec()
, and NOT withsshc.sftp.*
, as I have yet to see a crash from the SFTP subsystem.In other words, I suspect that
hivessh
has a race condition when you execute multiple commands at the same time asynchronously across multipleSshHost
s.To this end, I suggest that the above error message be updated to include the reason why the socket was closed or lost connection.
Inspecting an
SshHost
instance reveals this might be referring toSshHost.closeErr
, but the message is unclear as to precisely where one should go looking.For example, the error could instead read:
...for example, making something up:
The text was updated successfully, but these errors were encountered: