Revision 3c0d60d0

b/lib/jqueue.py
429 429
    Processor.ExecOpCode) set to OP_STATUS_WAITLOCK.
430 430

  
431 431
    """
432
    self._queue.acquire()
432
    self._queue.acquire(shared=1)
433 433
    try:
434 434
      assert self._op.status in (constants.OP_STATUS_WAITLOCK,
435 435
                                 constants.OP_STATUS_CANCELING)
......
446 446
    finally:
447 447
      self._queue.release()
448 448

  
449
  @locking.ssynchronized(_big_jqueue_lock)
449
  @locking.ssynchronized(_big_jqueue_lock, shared=1)
450 450
  def _AppendFeedback(self, timestamp, log_type, log_msg):
451 451
    """Internal feedback append function, with locks
452 452

  
......
626 626
            logging.info("Op %s/%s: Starting opcode %s", idx + 1, count,
627 627
                         op_summary)
628 628

  
629
            queue.acquire()
629
            queue.acquire(shared=1)
630 630
            try:
631 631
              if op.status == constants.OP_STATUS_CANCELED:
632 632
                raise CancelJob()
......
646 646
            result = proc.ExecOpCode(input_opcode,
647 647
                                     _OpExecCallbacks(queue, job, op))
648 648

  
649
            queue.acquire()
649
            queue.acquire(shared=1)
650 650
            try:
651 651
              op.status = constants.OP_STATUS_SUCCESS
652 652
              op.result = result
......
661 661
            # Will be handled further up
662 662
            raise
663 663
          except Exception, err:
664
            queue.acquire()
664
            queue.acquire(shared=1)
665 665
            try:
666 666
              try:
667 667
                op.status = constants.OP_STATUS_ERROR
......
679 679
            raise
680 680

  
681 681
      except CancelJob:
682
        queue.acquire()
682
        queue.acquire(shared=1)
683 683
        try:
684 684
          job.MarkUnfinishedOps(constants.OP_STATUS_CANCELED,
685 685
                                "Job canceled by request")
......
690 690
      except:
691 691
        logging.exception("Unhandled exception")
692 692
    finally:
693
      queue.acquire()
693
      queue.acquire(shared=1)
694 694
      try:
695 695
        try:
696 696
          job.lock_status = None

Also available in: Unified diff