mosquito / aio-pika

AMQP 0.9 client designed for asyncio and humans.
https://aio-pika.readthedocs.org/
Apache License 2.0
1.18k stars 186 forks source link

Recurrent RPC timeout on queue.cancel() #546

Open odesenfans opened 1 year ago

odesenfans commented 1 year ago

Hello,

I am experiencing a rather annoying issue when cleaning up a queue. I set up a queue to feed a websocket. Once the websocket closes, I sometimes experience a "ChannelInvalidStateError: Channel closed by RPC timeout" exception on await queue.cancel(consumer_tag). I have no idea why this occurs.

Setup

The code is open source: https://github.com/aleph-im/pyaleph/blob/64c97e2a47071e028d0e929f512b0a7439c94661/src/aleph/web/controllers/messages.py#L362

In terms of stats, my app has:

Note that these queues are not very active. There's only a message every few seconds.

Any idea?

mosquito commented 1 year ago

Is is possible to make traffic dump beetween python proccess and broker?

odesenfans commented 1 year ago

Sure, what's the easiest way to achieve that?

mosquito commented 1 year ago
odesenfans commented 1 year ago

I started a tcpdump process on that server, I'll send you the dump once the error occurs again.

odesenfans commented 1 year ago

Okay, I logged all traffic to rabbitmq with tcpdump. I'm curious to understand how you make use of that, it's rather verbose! The "channel closed by RPC timeout" error occurred at 18:47:09 UTC (20:47:09 CET). I cut the logs from 20:40 to 20:50. Let me know if this is what you need.

rabbitmq-log.txt

odesenfans commented 1 year ago

Did you have the chance to take a look?

Aurvandill commented 1 year ago

Hello @odesenfans

I think the logs are no good for what @mosquito would need. He needs the packet content from some specific packages. The log you provided just contains what connections were made and not the content. I think @mosquito could maybe specify what packets he needs exactly.