reugn/go-quartz

Is there any way to monitoring missfired job?

joint-song opened this issue · 5 comments

I found some jobs because of short OutdatedThreshold or insufficient WorkerLimit configuration were missfired. How can I find these situations as soon as possible?

I understand that the problem is that when using a worker pool, sometimes jobs are waiting to be processed, and their next execution time will likely be expired next time. In this case, I would suggest extending the OutdatedThreshold duration. But I agree, there is a problem with visibility. There are several ways to approach this, but have you thought about what would work best for you?

Java-quartz has MisfireInstruction to preventing this kind of outdated cron jobs. It has three options: MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY, MISFIRE_INSTRUCTION_FIRE_ONCE_NOW and MISFIRE_INSTRUCTION_DO_NOTHING to be configured. I think this is necessary for some scenarios.

@joint-song, a configuration property may be introduced in the upcoming release to address this requirement.

@joint-song, PR #129 introduces a dedicated channel for managing misfired jobs. Providing a channel instead of a configuration flag gives the user more flexibility and control. Let me know if this aligns with your requirements.

Yes, this solved my problem well, thanks for your help!