rhettg / Tron

Next generation batch process scheduling and management
Other
11 stars 0 forks source link

Re-enabling a disabled daily job unexpectedly schedules it #59

Open jfennell opened 13 years ago

jfennell commented 13 years ago

I have a search_stats job that is supposed to run daily at 3AM.

I had it disabled because I was fiddling with the config. I forgot to re-enable it until ~10AM today (long after it was scheduled) and when I did two things happened:

I assume the job that just started was the 'daily' job that I had expected to not have run because it was past 3AM. I'm not sure of the exact tron semantics, but this seems like surprising and potentially dangerous behavior.

irskep commented 12 years ago

I don't know how often people run into this, but it shouldn't be too hard to add a Y/N prompt.

This happens because the scheduler's logic says, "What would the next run time be, starting at the time of the previous run?" The job was scheduled in the past, so the scheduler chooses the next day (also in the past), causing some higher-up logic to run it immediately, since it is past due.

Instead, *Scheduler.next_runs() should have an argument ignore_past_runs=False which forces the scheduler to consider only the future, and tronctl should pass this parameter to the web service JobResource.render_POST/enable to be propagated to the MCP, scheduler, etc.