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

Ability to retry dead jobs manually #54

Open
CodechCFA opened this issue Mar 10, 2021 · 3 comments
Open

Ability to retry dead jobs manually #54

CodechCFA opened this issue Mar 10, 2021 · 3 comments

Comments

@CodechCFA
Copy link

CodechCFA commented Mar 10, 2021

One of the biggest reasons we used https://github.com/gocraft/work is that it has the ability in the UI to retry jobs manually that have exhausted their automatic retries. Given that this project has moved the UI solution to prometheus/grafana, are there any plans for covering the need to retry dead jobs manually?

@taylorchu
Copy link
Owner

The default behavior changes to retrying job forever for simplicity, but here are some ways to customize this:

  1. use work.ErrDoNotRetry. This will cause a job to be not acked, and not reenqueued. You can then use your middleware to enqueue with your preferred backoff period.
  2. use discard.AfterXXX middleware. It means this job will be automatically removed after a certain period, or retry count.

@CodechCFA
Copy link
Author

That makes sense for managing the number of times a job retries. My question was around what to do with a job after it has exhausted its retries. Being able to manage dead jobs is incredibly important because it allows you to investigate what jobs failed, why they failed, and what to do with them, such as retrying them again or deleting them. https://github.com/gocraft/work Allows exactly this. Without having that ability here, we'll have to continue using https://github.com/gocraft/work

@taylorchu
Copy link
Owner

I see. (in v2, there is no dead job because there is no concept of max retries or exhausted max retries; the job just keeps retrying forever. )

This will be a nice addition with a middleware package to put jobs with exhausted max retries into a different place, and provide UI to discard or retry (put them back to the normal queue).

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

2 participants