-
Notifications
You must be signed in to change notification settings - Fork 476
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
connect() calls its own callback multiple times upon error #354
Comments
I get the same. Looks like a bug. Could be fixed by wrapping openCallback so that it only ever is executed once, or by checking / setting a flag wherever openCallback is called, however both of these solutions would mean suppressing socket errors that occurred after successfully connecting. @squaremo thoughts? |
I suspect this is the root cause of onebeyond/rascal#17 |
I ran into this issue as well. As a work around, I used |
This seems better in 0.5.2, however I'm I've just hit a similar problem with errors returned from Steps to reproduce
If the subscription hasn't complete by the time the connection is closed, amqplib executes the create channel callback multiple times. |
This bug, combined with the retry code presented here: https://www.cloudamqp.com/docs/nodejs.html Can DDoS RabbitMQ. It's a shame it hasn't been addressed yet |
Duplicate of #402 |
Hello.
If I try to connect to a queue using invalid credentials, such as this:
The callback is called two times with an
err
parameter. First one that gives me access denied, and then one with a socket close.This obviously causes my code to throw an exception due to the callback already having been called.
Is this working as intended?
First callback:
Handshake terminated by server: 403 (ACCESS-REFUSED) with message \"ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.\"
Second:
Socket closed abruptly during opening handshake
Thank you in advance.
The text was updated successfully, but these errors were encountered: