Skip to content
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

Connection.close() hangs until reconnect attempt is completed. #100

Open
MartinWickman opened this issue Sep 26, 2019 · 1 comment
Open

Comments

@MartinWickman
Copy link

When calling connection.close() on the wrapper and the rabbit connection is currently down, there is a 5 seconds delay before the connection dies. This makes the nodejs process hang until that happens.

My guess is this due to a reconnect setTimeout() pending. Close() should clear this timeout to allow the node process to exit in a timely manner.

@MartinWickman MartinWickman changed the title Connection.close() should clear timeouts Connection.close() hangs until reconnect attempt is made. Sep 26, 2019
@MartinWickman MartinWickman changed the title Connection.close() hangs until reconnect attempt is made. Connection.close() hangs until reconnect attempt is completed. Sep 26, 2019
@enzoferey
Copy link

enzoferey commented Nov 29, 2020

@MartinWickman did you find any solution for this ? @jwalton any insights you might be able to share ?

I can see this is caused because of this line:

https://github.com/jwalton/node-amqp-connection-manager/blob/master/src/AmqpConnectionManager.js#L207

and this line:

https://github.com/jwalton/node-amqp-connection-manager/blob/master/src/AmqpConnectionManager.js#L183

Where reconnectTimeInSeconds defaults to heartbeatIntervalInSeconds, which default to 5.

@CS-BTurner you are the one who did changes on this code last, any insights ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants