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

Task will never fire again if I reboot my program. #63

Open
IndustriousSnail opened this issue May 7, 2021 · 0 comments
Open

Task will never fire again if I reboot my program. #63

IndustriousSnail opened this issue May 7, 2021 · 0 comments

Comments

@IndustriousSnail
Copy link

Task will never fire again if I reboot my program. I follow the code of RedisJobStore and find that the trigger has 2 states, which are waiting and acquired(the redis key is prefix_acquired_triggers and prefix_waiting_triggers). If the task state was acquired when I shutdown my program, then QuartzSchedulerThread couldn't get the waiting triggers and couldn't fire the task.

The code of QuartzSchedulerThread is the following:

image

  1. The QuartzSchedulerThread will get triggers with waiting state and convert its waiting state to acquired state.(delete it and then add it)

image

  1. And in the below, the QuartzSchedulerThread fires the task and then converts its acquired state to a waiting state.

QuartzSchedulerThread will repeat the action over and over again.

However:
When I reboot my program and the state of task is acquired, and then the first step can't get the task so that the task will never be fired again.


PS: I found the task will be fired again after my program starts 5-10 minutes(The cron of my task is 0/5 * * * * ?).

Why can't the task recover right away when my program starts? And what should I do?

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