-
Notifications
You must be signed in to change notification settings - Fork 204
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
Error: connect: Unexpected end event #568
Comments
From memory, I think the reason there is no reject is that it broke the
code which manages the connection retries. Having a reject resulted in
no subsequent retries being attempted after a failure.
To be honest, I have never liked the retry code. It was originally added
via a PR and I wsas hesitant to add it at the time, but bowed down to
pressure. It has resulted in far more complex connection code than I
would prefer.
One side effect is that you have the corner case your experiencing. I
will try to find time in the next month to have a look and retest with
using reject, but I'm not confident. A big problem is reproduction. Very
hard to trigger thye connection error at just the right point to trigger
what you are seeing.
If you wanted to try some fixes, quite willing to consider PRs provided
all tests in the test suite pass.
|
I am having the exact problem. |
I think I might have the same issue when using the ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This error is crashing the server. I am on version 11.0.0
connect() calls addTempListeners(this, 'connect') without a reject argument
Inside the connect method, we have this line:
listeners = addTempListeners(this, 'connect');
However, the 'getConnection' call does pass the reject, so if the SSH2 'end' event fires during getConnection, it correctly calls reject(newError), turning into a Promise rejection.
Is there any specific reason it is designed in such a way? Can we do something like this:
The text was updated successfully, but these errors were encountered: