sdcote / loader

Component loader for 12-factor apps and embedded JREs.
MIT License
2 stars 1 forks source link

Scheduler: Scheduled Job Initial Run #1

Closed sdcote closed 7 years ago

sdcote commented 8 years ago

Scheduler does not always schedule jobs to run if the current time is close to the next allowable time.

Case: four jobs were scheduled at 8:58 for /5, /15, /30 and minute=0. Only the job scheduled for /5 ran at 9:00, the others ran at their respective times after 9:00.

This may be due to the scheduler itself having just been initialized.

sdcote commented 8 years ago

This looks to be related to the way the scheduler queues up the jobs. It may place rescheduled jobs before the other jobs of the same time not after like it should.

131639:1 | Handling 'Simple' now - next job 'CSV-FLF' to run at Sun Feb 14 23:15:00 EST 2016
131640:1 | Simple enabled=true cancelled=false limit=0 count=0 repeat=true
131640:0 | Running Simple in threadpool
131641:1 | Scheduler.wkr.1 handling Simple - total runs=0
131641:0 | Repeating job Simple execution time = 1455508799970,  target interval = 299997
131643:2 | Set execution time to Sun Feb 14 23:05:00 EST 2016 execution time = 1455508799970,  target interval = 299995
131644:0 | Scheduling job Simple to run at Sun Feb 14 23:05:00 EST 2016
131644:1 | Job scheduled in list of 4 jobs; next job 'Simple' to run at Sun Feb 14 23:05:00 EST 2016
131646:2 | Scheduled repeating job Simple (runs=1 interval=299992) will run again at Sun Feb 14 23:05:00 EST 2016
131647:1 | Next job 'Simple' to run at Sun Feb 14 23:05:00 EST 2016
`
sdcote commented 7 years ago

This appears to be fixed