Inconsistent Blocking Connection hanging when consumer is idle
See original GitHub issuePika: 0.12.0b2 OS: Ubuntu
When the connection is left idle for a long time (e.g. 10 hours). A consumer hangs and does not consume anymore messages. This used to happen on pika 0.10 and it appeared to be solved in v. 0.11 Following example in Pika Examples, the issue could be reproduced.
Moreover:
- the same problem is difficult to reproduce when pushing to localhost (respect to RabbitMQ in another host/network)
- no specific output from pika (at debug level)
- RabbitMQ does not simply to complain about heartebeats
- When pushing new messages, it appears a “strange log”, that looks like it comes from pika application (that should consume)
rabbit | =WARNING REPORT==== 15-May-2018::08:59:41 ===
rabbit | closing AMQP connection <0.1090.0> (192.168.1.1:44386 -> 172.18.0.2:5672):
rabbit | client unexpectedly closed TCP connection
Apart from big headaches, I would like to point out that in pika 0.11.2 this problem should not be present, but another takes places. When operating very long tasks connection is dropped as well.
Issue Analytics
- State:
- Created 5 years ago
- Comments:31 (19 by maintainers)
Top Results From Across the Web
Stop channel.basic_consume if the connection is idle/Not ...
I want the consumer to get exited or have a callback method to decide on what i need to do? Like sending a...
Read more >Source code for pika.adapters.blocking_connection
"""The blocking connection adapter module implements blocking semantics on top of Pika's core AMQP driver. While most of the asynchronous expectations are ...
Read more >Solving My Weird Kafka Rebalancing Problems & Explaining ...
While Kafka is rebalancing, all involved consumers' processing is blocked (Incremental rebalancing aims to revoke only partitions that need ...
Read more >Solved: Console producer/consumer not working in kafka 0.1...
Hi,. We have recently started using kafka 0.10.2 but are unable to produce any messages or consumer them. It has kerberos enabled. Below...
Read more >DIFFERENCES BETWEEN PROCESSES, SESSIONS AND ...
What's the difference between connections, sessions and processes? ... "Oracle decided to keep trickling dirty blocks to disc at a higher rate than...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lukebakken, I think the suggestion to use SelectConnection wouldn’t improve the situation, just make his code more complicated due to “callback hell” 😃. Also, the suggestion to use
add_timeout
to delegate processing to the correct thread looks like a typo. If someone is using SelectConnection directly, and need to schedule a callback inside SelectConnection’s I/O loop safely, they should call theadd_callback_threadsafe()
method of that SelectConnection’s I/O loop directly -connection.ioloop.add_callback_threadsafe(...)
- notadd_timeout
which isn’t thread-safe.@lukebakken
I am doing my tests with 0.12.0.b2 and heartbeats at 600s
While testing I am capturing packets (Wireshark). Everything is working smoothly since this morning in the scenario.
I will see if by tomorrow the connection is still available leaving it idle all night long. If this works I would repeat the tests with: