kagkarlsson / db-scheduler

Persistent cluster-friendly scheduler for Java
Apache License 2.0
1.23k stars 188 forks source link

Keeping scheduled task in database after exhausting all retries #480

Closed hamid646m closed 2 months ago

hamid646m commented 4 months ago

I would like to recommend an enhancement: using a configuration to store failed tasks in the database. Here's a use-case I've encountered: for a task, I employ short retries, typically due to incorrect data. Once all retry attempts are exhausted, I receive a notification. At that point, I rectify the data and update the execution_time so the task can be reattempted. What do you think?

kagkarlsson commented 4 months ago

Yeah, I think that is an interesting addition to db-scheduler. I think it is about the same ideas as this: https://github.com/kagkarlsson/db-scheduler/issues/27

adamalexandru4 commented 4 months ago

I've managed by doing a custom FailureHandler called MaxRetriesNoDeleteFailureHandler without executionOperations.stop();. I can contribute if you want to implement in this way @kagkarlsson.

Another idea could be to implement the pause method on ExecutionOperations (I can help with this too)

kagkarlsson commented 4 months ago

I've managed by doing a custom FailureHandler called MaxRetriesNoDeleteFailureHandler without executionOperations.stop();

I don't think that will work. It will be considered dead at some point

You are welcome to try implementing #27. I am not sure how straight-forward it will be, there is a bit of exploration to it..

kagkarlsson commented 2 months ago

Closing since duplicate of #27