Statistics
| Branch: | Tag: | Revision:

root / test / ganeti.jqueue_unittest.py @ 37531236

History | View | Annotate | Download (74.2 kB)

# Date Author Comment
fcb21ad7 07/21/2011 02:55 pm Michael Hanselmann

Export job dependencies through lock monitor

This makes them visible to the user. Example:

$ gnt-debug locks -o name,pending
Name Pending
job/890 job:891,892
job/892 job:894

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

47099cd1 07/21/2011 02:20 pm Michael Hanselmann

Rename *_STATUS_WAITLOCK to …_WAITING

This patch renames the {JOB,OP}_STATUS_WAITLOCK constants to {JOB,OP}_STATUS_WAITING, as per design document for chained jobs.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

75d81fc8 07/21/2011 11:58 am Michael Hanselmann

Fix locking issue with job dependencies

When jobs waiting for a dependency are notified, they're re-added to the
queue. This would require owning the queue lock in exclusive mode, but
since the function doing so is called from within the job/opcode
processor, it only holds the lock in shared mode....

c0f6d0d8 07/20/2011 03:11 pm Michael Hanselmann

jqueue: Add “writable” flag to memory objects

Basically only one instance of the job, the one being processed,
should be serialized to disk and replicated to other nodes. With
this flag assertions can be added in various places.

Signed-off-by: Michael Hanselmann <>...

b95479a5 07/20/2011 03:11 pm Michael Hanselmann

Implement chained jobs

An overview is available in the design document for this change,
doc/design-chained-jobs.rst.

When a job enters the job processor, the current opcode's dependencies
are evaluated. If a referenced job has not yet reached the desired...

1e6d5750 06/03/2011 02:10 pm Iustin Pop

Fix incomplete merge

Commit 66bd7445 changed the semantics of _JobProcessor on finished
jobs, and updated the related unittests in the 2.4 branch. It was then
merged to master, however on master there was an additional test for
this case, which was not updated....

07346f28 06/01/2011 08:08 pm Michael Hanselmann

Merge branch 'devel-2.4'

  • devel-2.4:
    jqueue: Fix potential race condition when cancelling queued jobs
    Fix argument order in ReserveLV and ReserveMAC

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

66bd7445 05/31/2011 07:17 pm Michael Hanselmann

jqueue: Fix potential race condition when cancelling queued jobs

When a job was cancelled, its status would be changed and the file
written again. Since this was a final status, the job file could be
moved anytime for archival. If the job was still in the queue, however,...

6a373640 03/25/2011 03:53 pm Michael Hanselmann

Implement submitting jobs from logical units

The design details can be seen in the design document
(doc/design-lu-generated-jobs.rst).

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

c6afb1ca 01/18/2011 01:47 pm Iustin Pop

Rename OpGetTags and LUGetTags

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>
Reviewed-by: Michael Hanselmann <>

30c945d0 12/29/2010 05:48 pm Michael Hanselmann

jqueue: Fix cancelling while in waitlock in queue

Since the recent change to leave jobs in the “waitlock” status (commit
5fd6b6947), cancelling a job while it's back in the queue would break.
This patch handles these cases and adds a unittest.

Signed-off-by: Michael Hanselmann <>...

5fd6b694 12/15/2010 03:42 pm Michael Hanselmann

jqueue: Keep jobs in “waitlock” while returning to queue

Iustin Pop reported that a job's file is updated many times while it
waits for locks held by other thread(s). After an investigation it was
concluded that the reason was a design decision for job priorities to...

ebb2a2a3 12/15/2010 03:42 pm Michael Hanselmann

Improve jqueue unittests

- Verify job file updates
- Ensure queue lock is released while executing opcode

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

9e49dfc5 10/12/2010 03:48 pm Michael Hanselmann

jqueue: Fix bug when cancelling jobs

If a job was cancelled while it was waiting for locks, an assertion
would've failed. This patch fixes the problem and provides a unit
test to check for this situation.

Signed-off-by: Michael Hanselmann <>...

f23db633 09/24/2010 06:18 pm Michael Hanselmann

jqueue: Use priority for acquiring locks

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

26d3fd2f 09/24/2010 06:18 pm Michael Hanselmann

jqueue: Use timeout when acquiring locks

As already noted in the design document, an opcode's priority is
increased when the lock(s) can't be acquired within a certain amount of
time, except at the highest priority, where in such a case a blocking
acquire is used....

03b63608 09/23/2010 12:07 pm Michael Hanselmann

jqueue: Rename current_op to better reflect what it actually is

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

db5bce34 09/22/2010 05:38 pm Michael Hanselmann

jqueue: Add unittest for _QueuedJob.CalcStatus

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

be760ba8 09/20/2010 03:41 pm Michael Hanselmann

jqueue: Change model from per-job to per-opcode processing

In order to support priorities, the processing of jobs needs to be
changed. Instead of processing jobs as a whole, the code is changed to
process one opcode at a time and then return to the queue. See the...

5f6b0b71 09/16/2010 01:26 pm Michael Hanselmann

Add small jqueue unittests

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

8f5c488d 09/13/2010 06:35 pm Michael Hanselmann

Add support for job priority to opcodes and job queue objects

This allows clients to submit opcodes with a priority. Except for being
tracked by the job queue, it is not yet used by any code.

Unittests for jqueue._QueuedOpCode and jqueue._QueuedJob are provided for...

6760e4ed 09/07/2010 12:44 pm Michael Hanselmann

jqueue: Use separate function for encoding errors

Comes with unittest.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

989a8bee 07/15/2010 05:37 pm Michael Hanselmann

jqueue: Factorize code waiting for job changes

By splitting the _WaitForJobChangesHelper class into multiple smaller
classes, we gain in several places:

- Simpler code, less interaction between functions and variables
- Easy to unittest (close to 100% coverage)...