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

Job specific cleanup handler when pool shutdown due to SigTerm #163

Open
srininara opened this issue Aug 6, 2020 · 0 comments
Open

Job specific cleanup handler when pool shutdown due to SigTerm #163

srininara opened this issue Aug 6, 2020 · 0 comments

Comments

@srininara
Copy link

As part of a Job we are able to configure a function that executes to run the job.

If the scheduler (or pool) gets a SigTerm, is there a way for the scheduler to execute a different function with the job parameters and context so that this function can do a cleanup of the job and set the status of the job as needed? This will ensure that jobs don't leave the system in a inconsistent state.

Not sure if middlewares can do this. From the documentation it looks like middlewares are called before the job automatically and we don't have ways to trigger middleware handler on specific scenarios. Also middlewares are not specific to a job so doing it in middleware could be very complex.

Please suggest how we can handle the same.

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