node-amqp-connection-manager
node-amqp-connection-manager copied to clipboard
Connection.close() hangs until reconnect attempt is completed.
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 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 ?