Revision 271daef8

b/lib/jqueue.py
418 418
    self._job = job
419 419
    self._op = op
420 420

  
421
  @locking.ssynchronized(_QUEUE, shared=1)
421 422
  def NotifyStart(self):
422 423
    """Mark the opcode as running, not lock-waiting.
423 424

  
......
427 428
    Processor.ExecOpCode) set to OP_STATUS_WAITLOCK.
428 429

  
429 430
    """
430
    self._queue.acquire(shared=1)
431
    try:
432
      assert self._op.status in (constants.OP_STATUS_WAITLOCK,
433
                                 constants.OP_STATUS_CANCELING)
431
    assert self._op.status in (constants.OP_STATUS_WAITLOCK,
432
                               constants.OP_STATUS_CANCELING)
434 433

  
435
      # All locks are acquired by now
436
      self._job.lock_status = None
434
    # All locks are acquired by now
435
    self._job.lock_status = None
437 436

  
438
      # Cancel here if we were asked to
439
      if self._op.status == constants.OP_STATUS_CANCELING:
440
        raise CancelJob()
437
    # Cancel here if we were asked to
438
    if self._op.status == constants.OP_STATUS_CANCELING:
439
      raise CancelJob()
441 440

  
442
      self._op.status = constants.OP_STATUS_RUNNING
443
      self._op.exec_timestamp = TimeStampNow()
444
    finally:
445
      self._queue.release()
441
    self._op.status = constants.OP_STATUS_RUNNING
442
    self._op.exec_timestamp = TimeStampNow()
443

  
444
    # And finally replicate the job status
445
    self._queue.UpdateJobUnlocked(self._job)
446 446

  
447 447
  @locking.ssynchronized(_QUEUE, shared=1)
448 448
  def _AppendFeedback(self, timestamp, log_type, log_msg):

Also available in: Unified diff