-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How should I handle TimeoutError? #186
Comments
However, I can't reproduce the case that Does this exception needs to be handled by the library or my application code? Using Python 3.5 on Linux. |
After some investigation I found out that In Linux, I have found that there are some default options that is set on the socket about TCP keep-alive feature starting from version 2.1.4: https://amqp.readthedocs.io/en/latest/changelog.html#version-2-1-4 These parameters are defined here in code: Lines 36 to 42 in 068223d
I think |
@cenkalti, I see a similar Timeout problem when using a Celery
Did changing the TCP timeout solve this? A “workaround” for this problem might be to revoke all tasks of a group one-by-one in a loop, although I have not yet tried that. |
@jenstroeger No, changing the |
@cenkalti, hmmm… ok 🤔I guess I’ll switch to plan B then and revoke all tasks of the group individually, while digging for the root cause of the timeout on our side. Thanks! |
@cenkalti, in my case the # group_results.revoke()
for result in group_results:
try:
_log.info("Revoking %s", result.id)
result.revoke()
except Exception as e:
_log.exception(f"Failed to revoke {result.id}!") It is the task which has already executed that causes the @georgepsarakis, is it possible to shed some light on that? |
Here having the same error:
Using def run():
with Connection(rabbit_url, read_timeout=30000, write_timeout=30000) as conn:
with open("foo.csv", "r") as fp:
exchange = Exchange("example-exchange-1", type="direct")
channel = conn.channel()
producer = Producer(exchange=exchange, channel=channel, routing_key="test")
queue = Queue(name="test-1", exchange=exchange, routing_key="test")
queue.maybe_bind(conn)
queue.declare()
for line in fp:
producer.publish(line, max_retries=3, errback=lambda x: print(x)) |
The text was updated successfully, but these errors were encountered: