On Sun, 2003-12-21 at 22:06, Phil Stracchino wrote:
> On Sun, Dec 21, 2003 at 09:17:49PM +0100, Kern Sibbald wrote:
> > My remarks were, unfortunately, not too clear. I found a bug in the
> > scheduling code that didn't take into account that the day could change
> > if you look 1 hour ahead. I fixed that. However, if suddenly the clock
> > is set back one hour, Bacula is not going to notice it, so there will b=
> > problems in the fall if you schedule any jobs just between 1am and 2am.
> > I'm not quite sure how Bacula would go about detecting a clock change
> > and correcting for it.
> Hmmmm..... I don't know if that would cause the behavior I observed or
> not. I deliberately did not have any jobs scheduled between 0100 and
> 0200, in part to avoid DST changing problems, and was therefore very
> surprised when jobs scheduled *after* 0200 executed *twice*.
> Does Bacula "pre-schedule" jobs? i.e, "It is now 0130, this job is
> scheduled for 0215, execute it in 45 minutes"?
Yes, to keep from "thrashing around" once a minute or once every job is
started, the Bacula scheduler thread builds a list of all jobs to start
between the current time until the end of the next hour (i.e. if it is
now 8:30, it looks for jobs from 8:30 until 9:59). It then goes to sleep
until the next job is to be run, wakes up, runs it, and takes the next
job on the list. When the list is empty, it builds a new list of jobs
(same algorithm). If jobs are put into the list, it sleeps a configured
time (currently 60 seconds) and then retries building a list. Also, if
lots of jobs are scheduled at the same time, this algorithm avoids the
possibility of accidentally re-running one or more of them.
The new 1.33 scheduler is much cleaner than the 1.32 schedule because it
is implemented with my home grown C++ dlist class rather than a
malloc'ed table, and it sorts by start time and Priority. In the next
couple of days, it will run in UTC (GMT) time, and thus no longer be
subject to daylight savings clock shifts that you saw (thanks for
reporting it, and thanks to Alan Brown for providing the solution).
> > > Excellent! I haven't gotten around to downloading the 1.33 beta (bee=
> > > busy with job interviews and medical stuff) but I'll try and pull dow=
> > > 1.33 as soon as I can, and start banging on it.
> > You probably mean 1.32e (21Dec03). You are *very* welcome to try 1.33
> > but it requires a database update and is not production ready.
> Sorry, I misunderstood ... I assumed an implied "1.33 is available for
> download" that was not actually there.
> > Best wishes on both the job interviews and the medical stuff ...
> Thanks. The foot's looking good this time. I can even get my
> motorcycle boots on without it hurting, even *before* getting the last
> (and biggest) pin out.