Skip to content
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

Catch TimeLimitExceeded exception #23

Open
charleshan opened this issue Jun 23, 2020 · 2 comments
Open

Catch TimeLimitExceeded exception #23

charleshan opened this issue Jun 23, 2020 · 2 comments

Comments

@charleshan
Copy link
Contributor

Job status info: [Dry run] 4/5 Generating import summary
The job status info was stuck on this step and when I checked the logs, I found TimeLimitExceeded exception.

2020-06-23T16:53:24.028548585Z app[worker.2]: [2020-06-23 09:53:24,027: ERROR/MainProcess] Task handler raised error: TimeLimitExceeded(300)
2020-06-23T16:53:24.028599784Z app[worker.2]: Traceback (most recent call last):
2020-06-23T16:53:24.028605055Z app[worker.2]:   File "/app/.heroku/python/lib/python3.7/site-packages/billiard/pool.py", line 684, in on_hard_timeout
2020-06-23T16:53:24.028609276Z app[worker.2]:     raise TimeLimitExceeded(job._timeout)
2020-06-23T16:53:24.028625581Z app[worker.2]: billiard.exceptions.TimeLimitExceeded: TimeLimitExceeded(300,)
2020-06-23T16:53:24.036035220Z app[worker.2]: [2020-06-23 09:53:24,035: ERROR/MainProcess] Hard time limit (300s) exceeded for import_export_celery.tasks.run_import_job[45422346-1572-4e69-ad7e-77a488cbf2ee]

A quick change to the config should fix the issue but I think we should catch the exception and add it to the job status info.

@timthelion
Copy link
Member

Since you have the exception and I don't, would you mind making a PR?

@charleshan
Copy link
Contributor Author

I'll see if I can find some time.


For documentation, these are the configurations that would cause the exceptions.

http://docs.celeryproject.org/en/latest/userguide/configuration.html#task-time-limit
CELERY_TASK_TIME_LIMIT = 60

http://docs.celeryproject.org/en/latest/userguide/configuration.html#task-soft-time-limit
CELERY_TASK_SOFT_TIME_LIMIT = 60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants