[MGNLSCH-63] Handle jobs scheduled for the past Created: 25/May/16  Updated: 19/May/22  Resolved: 19/May/22

Status: Closed
Project: Scheduler
Component/s: None
Affects Version/s: 2.2.2
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Ondrej Chytil Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

Cron allows to set a job for one time execution (e.g. 0 45 0 25 5 ? 2016). When such a job is finished following exception is thrown (the same when the cron for the past is inserted directly)

2016-05-10 16:57:47,385 ERROR info.magnolia.module.scheduler.JobDefinition      : Can't initialize job [RunCommandLater-1462896906716]
org.quartz.SchedulerException: Can't schedule jobRunCommandLater-1462896906716 [See nested exception: org.quartz.SchedulerException: Based on configured schedule, the given trigger will never fire.]
        at info.magnolia.module.scheduler.SchedulerModule.initJob(SchedulerModule.java:172)
        at info.magnolia.module.scheduler.SchedulerModule.initJobs(SchedulerModule.java:156)
        at info.magnolia.module.scheduler.SchedulerModule.start(SchedulerModule.java:146)
        at info.magnolia.module.ModuleManagerImpl.startModule(ModuleManagerImpl.java:414)
        at info.magnolia.module.ModuleManagerImpl$2$1.doExec(ModuleManagerImpl.java:373)
        at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:421)
        at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:418)
        at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:392)
        at info.magnolia.module.ModuleManagerImpl$2.onEvent(ModuleManagerImpl.java:368)
        at info.magnolia.cms.util.ObservationUtil$ObservationBasedDelayedExecutor$1.run(ObservationUtil.java:276)
        at info.magnolia.cms.util.DelayedExecutor$RunnableWrapper.run(DelayedExecutor.java:103)
        at EDU.oswego.cs.dl.util.concurrent.ClockDaemon$RunLoop.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.quartz.SchedulerException: Based on configured schedule, the given trigger will never fire.
        at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:817)
        at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:243)
        at info.magnolia.module.scheduler.SchedulerModule.startJob(SchedulerModule.java:199)
        at info.magnolia.module.scheduler.SchedulerModule.initJob(SchedulerModule.java:170)
        ... 12 more

Instead such event should be handled by the module.
Proposed solution - set enabled property of the job to false and print INFO or WARN level message.



 Comments   
Comment by Roman Kovařík [ 19/May/22 ]

Hello,

This ticket is now marked as closed due to one of the following reasons:

  • A long period of inactivity
  • Uses an old or Beta version of an application, module, or framework that we no longer support
  • The issue is no longer reproducible or has been fixed in later versions

If you are still facing a problem or consider this issue still relevant, please feel free to re-open the ticket and we will reach out to you.

Thank you,
The Magnolia Team

Generated at Mon Feb 12 10:45:31 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.