-
Notifications
You must be signed in to change notification settings - Fork 475
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
Failed "connect" call does not close socket #513
Comments
Add `sock.end` and `sock.destroy` calls for `sock.once('error', ...)` event handler and for `c.open(fields, ...)` callback - just like it was done for connection timeout callback. Resolves amqp-node#513
Just got into this exact issue when trying to connect with a non existent virtual host. Will try to work on a pull request now. |
Please look my PR. There was some problem in there tests I never managed to fix.... |
I think I found the issue. Even though what you did was the right thing, it conflicted with other |
Processing leak after rejectionWe had a similar problem with an integration test. In our case, the symptom: Our expectation is: At the time the promise rejects, all resources have been freed and all background processing pertaining the connection attempt has ceased. Our test framework (we use Jest) waits for another second, and in that second, not all background processing has terminated. DetailsWe have a standard RabbitMQ running via
and try to connect to it, using the default existing user and password, but also using a vhost that does not exist. The pertinent part of our (typescript) code is this:
|
amqplib v0.9.0 includes PR 647 which ends and destroys the socket. |
I am developing integration tests and have problems with negative case testing - my test app never exits.
Steps to Reproduce:
I found that reason is that the following block is only called on timeout:
And it is never called on other connection errors.
The text was updated successfully, but these errors were encountered: