aio-pika icon indicating copy to clipboard operation
aio-pika copied to clipboard

fix problem with dangling channels on connection restore

Open przemyslawfierek-silvair opened this issue 3 years ago • 2 comments

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:

  1. Open RobustConnection to a AMQP broker
  2. Create RobustChannel
  3. Create Queue with flags exclusive=True and auto_delete=True
  4. Close the channel (note that the Queue has been automatically deleted)
  5. Restart the AMQP broker
  6. Note that the Channel and the Queue 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.

mosquito avatar Oct 18 '21 10:10 mosquito