Statistics
| Branch: | Tag: | Revision:

root / src / Ganeti / JQScheduler.hs @ e181c8cd

History | View | Annotate | Download (17.7 kB)

# Date Author Comment
a15a030f 04/24/2014 03:13 pm Petr Pudlak

Fix a typo in a debug message

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

445c5ec4 04/24/2014 03:13 pm Petr Pudlak

Check for own locks when checking job death in Luxi

Otherwise a job that is being started is falsely reported as dead.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

1c409f58 04/24/2014 03:12 pm Petr Pudlak

Mark a job as failed, if it fails to start

.. and add a reason trail message. Otherwise failed jobs hang, never
finishing.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

c666e6aa 04/24/2014 09:46 am Petr Pudlak

When checking job death, check if its lock is the Luxi lock

In this case, the call trying to acquire a shared lock always succeeds,
because the daemon already has an exclusive lock, which falsely reports
that the job has died.

Signed-off-by: Petr Pudlak <>...

234f9032 04/24/2014 09:46 am Petr Pudlak

Fix a typo in a debug message

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

58d29849 04/22/2014 07:33 pm Klaus Aehlig

Add reason-trail entry on failing jobs

When failing a job, add an entry to the reason trail, indicating
what made the job fail (e.g., failed to fork or detected job death).

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

4b3e9fa7 04/17/2014 06:59 pm Klaus Aehlig

Clean up dead jobs from the job queue

Make the onTimeWatcher of the job queue scheduler also verify
that all notionally running jobs are indeed alive. If a job is
found dead, remove it from the list of running jobs and update
the job file to reflect the unexpected death....

efb4c025 04/17/2014 06:59 pm Petr Pudlak

Execute jobs as processes from Luxi

.. instead of just letting the master daemon to handle them.

We try to start all given jobs independently and requeue those that
failed.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

64f3a6ea 04/17/2014 06:56 pm Petr Pudlak

Add a livelock file for the Luxi daemon

The file is initialized and kept within JQStatus.
It is temporarily assigned to jobs spawned by Luxi until they create
their own livelock files.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

50d756af 04/10/2014 04:30 pm Klaus Aehlig

Fix a race in rescheduling jobs

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...

38b3e03d 04/10/2014 01:41 pm Klaus Aehlig

Schedule on jobs where all job dependencies are finished

Jobs may depend on other jobs in the sense that they may only be started
once a given job is finalized. For a job process, however, it is hard to
determine if the status of a different job without a significant overhead....

a2dbdd82 02/06/2014 02:16 pm Klaus Aehlig

Merge branch 'stable-2.11' into master

  • stable-2.11
    Implement ChangeJobPriority in luxid
    Provide a function to change the priority of a queued job
    When enqueuing new jobs, respect job ID
    Change return type of internal rmJob
    Add a function to change the priority of a job...
155df343 02/06/2014 12:43 pm Klaus Aehlig

Change return type of internal rmJob

...to also provide the job itself. In this way, the function can
also be used for tasks that require temporarily removing a job
from the queue.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

f7743189 02/06/2014 12:43 pm Klaus Aehlig

When enqueuing new jobs, respect job ID

When adding new jobs, don't add them at the end, but at a
position that fits with their job id. In this way, we can
build operations that require fully dequeing a job an adding
it later after some modifications.

Signed-off-by: Klaus Aehlig <>...

96d55b50 02/06/2014 12:43 pm Klaus Aehlig

Provide a function to change the priority of a queued job

There is a separation of responsibilities here. For jobs still
in the queue, it is the responsibility of the queue (scheduler),
for started jobs, the job itself has to take care of it. To avoid
the job transitioning inbetween, it is temporarily dequeued during...

ea7032da 01/30/2014 04:10 pm Petr Pudlak

Update getDirJobIDs to use ResultT

Also simplify code and remove unused functions.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

d9dd04b1 01/16/2014 05:11 pm Klaus Aehlig

Make the scheduler use the max_running_jobs config parameter

Use the run-time configuration to decide on the number of jobs
scheduled for execution instead of using a hard-coded constant.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

6046dca9 01/16/2014 05:11 pm Klaus Aehlig

Make configuration available to the scheduler

In this way, scheduling decisions can depend on the configuration
of the cluster. At the moment, this is only the maximal number
jobs to be run in parallel, but in the future this will also include
job filters....

bb62d52e 01/15/2014 02:33 pm Klaus Aehlig

Add dequeuing to the job scheduler

This only removes queued jobs from the queue
and indicates whether the job was found in the queue.
For jobs that are already started from the queue's
point of view, it might still be possible to cancel
them, e.g., if they are still waiting for locks....

ea174b21 01/07/2014 12:03 pm Klaus Aehlig

After detecting a finished job, schedule again

In order to obtain a higher throughput of jobs, schedule new jobs
as soon as a job was detected to have finished.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Helga Velroyen <>

b81650b0 01/07/2014 12:03 pm Klaus Aehlig

Attach a watcher for jobs

Add a function that can serve as an event handler for inotify
updating a job in the job queue if the corresponding job file
changes. Also attach it to all jobs selected to be run.

Signed-off-by: Klaus Aehlig <>...

a2977f53 01/07/2014 12:03 pm Klaus Aehlig

JQScheduler: always pass JobWithStat

When attaching inotifies to jobs, we need to preserve
it through potential requeuing actions. Also, this information
is needed for cleaning up.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Helga Velroyen <>

cc5ab470 01/07/2014 12:03 pm Klaus Aehlig

Cleanup inotifies

When cleaning up finished jobs, remove the inotify
attached to them, if any.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Helga Velroyen <>

ed6cf449 01/07/2014 12:03 pm Klaus Aehlig

Add an optional inotify to jobs in the scheduler

This provides the infrastructure to monitor running jobs
by inotify, and hence update the queue promptly upon
job changes.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Helga Velroyen <>

2713b91a 12/04/2013 05:52 pm Klaus Aehlig

Make luxid inspect the job queue on startup

Since luxid handled the scheduling, make luxid also read the queue
upon restart. In this way, jobs get scheduled in the same way, independent
of luxid restarts.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

1b3bde96 12/04/2013 05:52 pm Klaus Aehlig

Use the jobFinalized predicate in JQScheduler

...to improve readability.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

350f0759 12/03/2013 06:54 pm Klaus Aehlig

Don't assume we win the archive race

The job scheduler in luxid regularly watches for changes
of the job files to determine progress of jobs. As these
files are updated atomically, reading them will always
succeed---until they're archived. While luxid is quite...

1c532d2d 12/03/2013 12:26 pm Klaus Aehlig

Make JQScheduler handle failure on job starting

Given that luxid (at the moment) connects to masterd for starting
jobs, it may be that this inter-process communication fails. In
this case, just reschedule the jobs instead of killing the scheduler
thread....

7dd21737 12/03/2013 12:26 pm Klaus Aehlig

fix typo in log message

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Jose Lopes <>

fe50bb65 12/03/2013 12:26 pm Klaus Aehlig

Differentiate watchers in luxid

luxid has two time-based watcher threads, one for the
configuration, and one for the job queue. To improve readability
of the debug output, make both watcher use a different debug
message when the timer fires.

Signed-off-by: Klaus Aehlig <>...

48e4da5c 12/02/2013 04:08 pm Klaus Aehlig

Add a scheduler to keep track of the job queue

In order to allow informed decissions on when to start a job,
it is necessary for luxid to keep track of the (active part
of the) job queue. Add a scheduler, similar to the config reader,
that does this, but also schedules jobs to be executed. At the...