aio-pika
aio-pika copied to clipboard
fix problem with dangling channels on connection restore
This patch fixes problem with unexpected restoration already closed
channels (after reconnect to the AMQP broker) when the `RobustConnection`
is being used. The problem is caused by the not freeing reference to the
`aiopika.Channel._on_return` kept by the `aiormq.Channel.on_return_callbacks`,
which blocks garbage collector against free a `RobustChannel` object.
To reproduce issue:
- Open
RobustConnection
to a AMQP broker - Create
RobustChannel
- Create
Queue
with flagsexclusive=True
andauto_delete=True
- Close the channel (note that the
Queue
has been automatically deleted) - Restart the AMQP broker
- Note that the
Channel
and theQueue
has been restored
@przemyslawfierek-silvair thank you for your contribution. Please be patient, I have been allowing the execution of the test, but I am unlikely to be able to merge it in the near future.