amqplib icon indicating copy to clipboard operation
amqplib copied to clipboard

Close and destroy underlying socket after any connection error

Open xabinapal opened this issue 5 years ago • 6 comments

Ensure that on connection errors (either from the underlying socket or from the AMQP protocol) no more messages are send to the destination and fully close and destroy the socket. This fixes the open socket leak after sending invalid connection options, such as invalid credentials or virtual host, for example.

Based on #514, resolves #513.

xabinapal avatar Aug 21 '20 12:08 xabinapal

Thank you! Works great

carlhoerberg avatar Sep 30 '20 19:09 carlhoerberg

npm install squaremo/amqp.node#pull/584/head

for those of you that want to use this PR in your apps

carlhoerberg avatar Sep 30 '20 19:09 carlhoerberg

Didn't know that installing versions from PRs was an option, and this not being merged was a stopper for me. Good to know!

Just asking, @squaremo is this project not active anymore?

xabinapal avatar Sep 30 '20 19:09 xabinapal

@xabinapal from your perspective, is it possible to cover the code with tests? It would allow @squaremo to merge the PR without hesitation.

xamgore avatar Jan 19 '21 17:01 xamgore

I haven't thoroughly investigated how tests work in this library, only to ensure all test cases continue working as expected. I think it would be technically possible to add some tests to check that connection closes after an error.

Anyways, this library seems to be 100% abandoned. So many issues and PRs without owner's feedback, and this #418 issue searching for maintainers is also quiet since 2018.

With zero confidence on this PR being merged, I'm not willing to spend any time improving it, sorry. I'have been using it in production thanks to https://github.com/squaremo/amqp.node/pull/584#issuecomment-701591435 with no problems, and I encourage everyone who needs this to use that method. If @squaremo or any other maintainer relaunches this project, I will gladly spend more time on this issue.

xabinapal avatar Jan 30 '21 10:01 xabinapal

@xabinapal I know that quite a bit of time has passed, but would you be open to updating this PR? Library is not quite dead these days :)

kibertoad avatar Jun 25 '23 13:06 kibertoad