Sentry doesn't capture billiard.exceptions.TimeLimitExceeded from Celery
See original GitHub issueHi,
I’ve noticed that sentry-sdk doesn’t capture billiard.exceptions.TimeLimitExceeded
when a task fails.
I’ve tried Celery 3.1.26 and 4.4. Sentry-sdk is 0.14.1.
Example:
# tasks.py
from time import sleep
from celery import shared_task
@shared_task(time_limit=2)
def test_time_limit():
sleep(5)
Logs:
[2020-01-30 15:07:59,614: ERROR/MainProcess] Task handler raised error: TimeLimitExceeded(2,)
Traceback (most recent call last):
File "/Users/mmalysh/Development/my-website/venv/lib/python3.6/site-packages/billiard/pool.py", line 684, in on_hard_timeout
raise TimeLimitExceeded(job._timeout)
billiard.exceptions.TimeLimitExceeded: TimeLimitExceeded(2,)
[2020-01-30 15:07:59,627: ERROR/MainProcess] Hard time limit (2s) exceeded for api.tasks.test_foobar[e4f46f20-2311-4417-9ade-53e735430c65]
We didn’t have this problem with raven
. All other exceptions are reported properly. For example, this exception is reported as expected:
@shared_task
def test_bazqux():
raise Exception('BUY BITCOIN!')
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Celery integration not capturing error with ... - GitHub
The celery integration is failing to capture the exception when I use a celery factory ... Celery==4.2.1 Flask==1.0.2 sentry-sdk==0.7.4.
Read more >How to retry celery task on hard timeout? - Stack Overflow
Now in version 4.0 you can specify autoretry for specific exceptions in the decorator. Here is an example from the documentation ...
Read more >celery.exceptions — Celery 5.2.7 documentation
This exception does not inherit from CeleryError . billiard errors (prefork pool). SoftTimeLimitExceeded. TimeLimitExceeded. WorkerLostError. Terminated.
Read more >Hard time limit 65s exceeded on Worker 4 - On-Premise
I think the best way would be to build your own image based on the Sentry image and add the certs through a...
Read more >Celery Documentation - Read the Docs
Celery is easy to use and maintain, and it doesn't need configuration ... The soft time limit allows the task to catch an...
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
Ok! Then let’s close this one, we generally only aim to support stable releases of Celery unless somebody requires more.
Yes, hard limits work in 4.4