Connection drops when handling tasks with a long duration
See original GitHub issueI’m starting to get the same error as #418 even when I adjust the heartbeat connection parameter. My tasks take usually around 5 mins, but even then, when I set the heartbeat to both 0 and some very large number (ie: 60000)
My code Is essentially identical to the issue I mentioned above and the error I receive is this:
Traceback (most recent call last): File "instagram_worker.py", line 43, in <module> channel.start_consuming() File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 1780, in start_consuming self.connection.process_data_events(time_limit=None) File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 716, in process_data_events self._dispatch_channel_events() File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 518, in _dispatch_channel_events impl_channel._get_cookie()._dispatch_events() File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 1403, in _dispatch_events evt.body) File "instagram_worker.py", line 37, in dataHandler channel.basic_ack(delivery_tag=method.delivery_tag) File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 1988, in basic_ack self._flush_output() File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 1250, in _flush_output *waiters) File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 474, in _flush_output result.reason_text) pika.exceptions.ConnectionClosed: (-1, "error(104, 'Connection reset by peer')")
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:13 (8 by maintainers)
Top GitHub Comments
Try something like this:
Thanks @gmr