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

How do I handle job time out errors within the task? #434

Open
epicwhale opened this issue Mar 2, 2024 · 0 comments
Open

How do I handle job time out errors within the task? #434

epicwhale opened this issue Mar 2, 2024 · 0 comments

Comments

@epicwhale
Copy link

I have a task function which has a timeout explicitly set. When it times out I notice it throws the below exception(s) trace... and I am struggling to figure out where/how to handle it gracefully?

3.00s ! d786aa9ab9484760ada98578227f0bd3:example.task failed, TimeoutError: 
...

asyncio.exceptions.CancelledError
...

    raise TimeoutError from exc_val
                            └ CancelledError()

TimeoutError

I need to do some clean up of resources when such a timeout happens, but I need access to the initial parameters/args with which the task was called to do so. How do I handle this scenario?

If I register an on_job_end handle for my worker, the ctx in it does not receive the job information.

Any pointers would be appreciated!

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

No branches or pull requests

1 participant