AutorecoveringChannel close() vs abort()

90 views
Skip to first unread message

Péter Mihály Avramucz

unread,
Oct 19, 2020, 3:17:53 AM10/19/20
to rabbitmq-users
Hi All,

I'm having an issue where using an AutorecoveringConnection (and AutorecoveringChannel) when I call abort() on the channel, it is closed, but the consumer is not removed from the connection resulting in a memory leak. Calling close() corrently removed the consumer.
The JavaDoc of the method says nothing about this (or it's my eyes). Could someone describe what should be the correct usage here? Calling close() and if the channel still seems open, call abort()?

Br,
Peter

Wesley Peng

unread,
Oct 19, 2020, 3:20:53 AM10/19/20
to rabbitm...@googlegroups.com
You would provide the software (both client and server) versions you are
using.

Arnaud Cogoluegnes

unread,
Oct 19, 2020, 4:41:29 AM10/19/20
to rabbitm...@googlegroups.com
The close and abort method have the same behavior in terms of protocol frames, etc, with only one difference with a "abort" flag, which internal Javadoc says "abort: true if we should close and ignore errors". This means basically that any exception happening during the closing sequence is not propagated with abort.

________________________________________
From: rabbitm...@googlegroups.com <rabbitm...@googlegroups.com> on behalf of Péter Mihály Avramucz <mucz...@gmail.com>
Sent: Monday, October 19, 2020 9:17 AM
To: rabbitmq-users
Subject: [rabbitmq-users] AutorecoveringChannel close() vs abort()
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com<mailto:rabbitmq-user...@googlegroups.com>.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/bda2a572-2fb0-471a-9242-26cf3f273c3cn%40googlegroups.com<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Frabbitmq-users%2Fbda2a572-2fb0-471a-9242-26cf3f273c3cn%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Cacogoluegnes%40vmware.com%7C5973c5f59c99451b22c408d873ff1cd0%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637386886819973902%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=iR6%2FfJQSlzNkVgaicDR2PHcrhN4xk0ywrnSkwHnNT6A%3D&reserved=0>.

Péter Mihály Avramucz

unread,
Oct 19, 2020, 4:45:38 AM10/19/20
to rabbitmq-users
@wes: I'm using the latest 5.9.0 java client version.
@Arnaud: I see, but if you check the code, you will see, that abort() does not call "this.connection.deleteRecordedConsumer()" and "this.connection.unregisterChannel()" which results in a memory leak, so my question is what's the recommended way to use the api to close a channel.

Br,
Peter

Arnaud Cogoluegnes

unread,
Oct 19, 2020, 5:35:53 AM10/19/20
to rabbitm...@googlegroups.com
You're right, this is a bug. The abort method is rarely used, so I guess this is why this bug has been there for so many years.

abort() is just a commodity (not exception throwing), most people use close().

Thanks for reporting, I'll fix it.

________________________________________
From: rabbitm...@googlegroups.com <rabbitm...@googlegroups.com> on behalf of Péter Mihály Avramucz <mucz...@gmail.com>
Sent: Monday, October 19, 2020 10:45 AM
To: rabbitmq-users
Subject: Re: [rabbitmq-users] AutorecoveringChannel close() vs abort()

@wes: I'm using the latest 5.9.0 java client version.
@Arnaud: I see, but if you check the code, you will see, that abort() does not call "this.connection.deleteRecordedConsumer()" and "this.connection.unregisterChannel()" which results in a memory leak, so my question is what's the recommended way to use the api to close a channel.

Br,
Peter

On Monday, October 19, 2020 at 10:41:29 AM UTC+2 Arnaud Cogoluegnes wrote:
The close and abort method have the same behavior in terms of protocol frames, etc, with only one difference with a "abort" flag, which internal Javadoc says "abort: true if we should close and ignore errors". This means basically that any exception happening during the closing sequence is not propagated with abort.

________________________________________
From: rabbitm...@googlegroups.com <rabbitm...@googlegroups.com> on behalf of Péter Mihály Avramucz <mucz...@gmail.com>
Sent: Monday, October 19, 2020 9:17 AM
To: rabbitmq-users
Subject: [rabbitmq-users] AutorecoveringChannel close() vs abort()

Hi All,

I'm having an issue where using an AutorecoveringConnection (and AutorecoveringChannel) when I call abort() on the channel, it is closed, but the consumer is not removed from the connection resulting in a memory leak. Calling close() corrently removed the consumer.
The JavaDoc of the method says nothing about this (or it's my eyes). Could someone describe what should be the correct usage here? Calling close() and if the channel still seems open, call abort()?

Br,
Peter

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com<mailto:rabbitmq-user...@googlegroups.com>.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/bda2a572-2fb0-471a-9242-26cf3f273c3cn%40googlegroups.com<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Frabbitmq-users%2Fbda2a572-2fb0-471a-9242-26cf3f273c3cn%2540googlegroups.com&data=04%7C01%7Cacogoluegnes%40vmware.com%7C00dbbeeb758d40253c4308d8740b5e8b%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637386939468042907%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=OchGTvOVNlvr%2Bq%2BwBBN2amkKhIEeBOp%2FLYEELYoFZuk%3D&reserved=0><https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Frabbitmq-users%2Fbda2a572-2fb0-471a-9242-26cf3f273c3cn%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Cacogoluegnes%40vmware.com%7C5973c5f59c99451b22c408d873ff1cd0%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637386886819973902%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=iR6%2FfJQSlzNkVgaicDR2PHcrhN4xk0ywrnSkwHnNT6A%3D&reserved=0<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Frabbitmq-users%2Fbda2a572-2fb0-471a-9242-26cf3f273c3cn%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Cacogoluegnes%40vmware.com%7C00dbbeeb758d40253c4308d8740b5e8b%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637386939468052904%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=wAHtqHzQlyUt%2B9AeBJwG4U%2FKzB0h0rCtINTxId2jdig%3D&reserved=0>>.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com<mailto:rabbitmq-user...@googlegroups.com>.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/f9b92fc3-20b6-4c58-bf1d-60bc29eda73en%40googlegroups.com<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Frabbitmq-users%2Ff9b92fc3-20b6-4c58-bf1d-60bc29eda73en%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Cacogoluegnes%40vmware.com%7C00dbbeeb758d40253c4308d8740b5e8b%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637386939468052904%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=mADueyblQREJxssD9ynnmLvMKQvZXpszopx6y%2B6CG1M%3D&reserved=0>.

Péter Mihály Avramucz

unread,
Oct 19, 2020, 5:38:25 AM10/19/20
to rabbitmq-users
Thank you very much Arnaud!
Reply all
Reply to author
Forward
0 new messages