Closed isra17 closed 11 months ago
Is possible to restoring with passive=True
argument but really, what when you program has been restarted?
I still don't understand how this happened, how during the reconnection time someone redefined a queue with the same name but different arguments.
I've been experiencing 100% CPU usage and whole process hanging lately. After some more investigation I found it comes from aio-pika under certain scenario.
I'm able to reliably reproduce by declaring a
RobustQueue
withawait robust_channel.declare_queue(...)
that fails when the queue options change, getting the errorChannelPreconditionFailed: PRECONDITION_FAILED - inequivalent arg 'x-max-length-bytes' for queue 'repro-stream' in vhost '/': received '100' but current is '10'
Being able to attach to the process I see the thread looping in
aio_pika/robust_channel.py(77)ready()
whereself.__restored
isFalse
andself.__ready
isset
so thewait()
returns right away without yielding.Looking at the code, it seems like there's a window where
__ready
is set when__restored
is stillFalse
.Will try to open a PR with a fix.