LGTM, thanks
On Thu, Apr 10, 2014 at 3:01 PM, Klaus Aehlig <[email protected]> wrote: > When handling the queue, in particular at analyzing job dependencies, > we assume that all non-finalized jobs are present in the Queue data > structure. When rescheduling jobs we move them from the running part > of the queue to the scheduled part again. In order to comply with the > just mentioned in variant, we need to do so in a single atomic > modification instead of sequentially modifying the data structure. > > Signed-off-by: Klaus Aehlig <[email protected]> > --- > src/Ganeti/JQScheduler.hs | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/src/Ganeti/JQScheduler.hs b/src/Ganeti/JQScheduler.hs > index ced0db6..3a92395 100644 > --- a/src/Ganeti/JQScheduler.hs > +++ b/src/Ganeti/JQScheduler.hs > @@ -229,8 +229,7 @@ requeueJobs qstate jobs err = do > rmJobs = filter ((`notElem` jids) . qjId . jJob) > logWarning $ "Starting jobs failed: " ++ show err > logWarning $ "Rescheduling jobs: " ++ jidsString > - modifyJobs qstate (onRunningJobs rmJobs) > - modifyJobs qstate (onQueuedJobs $ (++) jobs) > + modifyJobs qstate $ onQueuedJobs (jobs ++) . onRunningJobs rmJobs > > -- | Schedule jobs to be run. This is the IO wrapper around the > -- pure `selectJobsToRun`. > -- > 1.9.1.423.g4596e3a > >
