I was playing with it and trying to work with properly deleting my queues / channels / connections when cancelling some tasks. I enabled the debug logger, and noticed that the event loop would stop, due to an exception. I traced it to those three locations, within queue.py:
The queue is being printed here using %r formatting in a debug message
repr is defined here, and basically prints the class name, the queue name and the consumer tag
This means that at that point, the class has no more _consumer_tag member, and all attempts to print it will fail. I can see two ways to fix it, but I'd like your opinion:
Modify repr to check for the presence / absence of consumer_tag using hasattr.
Modify the way _consumer_tag is handled, and set it to None instead of deleting it. This means we need to change all checks.
First of all, thanks for the library!
I was playing with it and trying to work with properly deleting my queues / channels / connections when cancelling some tasks. I enabled the debug logger, and noticed that the event loop would stop, due to an exception. I traced it to those three locations, within
queue.py
:%r
formatting in a debug messagerepr
is defined here, and basically prints the class name, the queue name and the consumer tagThis means that at that point, the class has no more
_consumer_tag
member, and all attempts to print it will fail. I can see two ways to fix it, but I'd like your opinion:repr
to check for the presence / absence ofconsumer_tag
usinghasattr
._consumer_tag
is handled, and set it to None instead of deleting it. This means we need to change all checks.