When a job is retried, it is effectively reset, so we have to
reset the state back to waiting again. This will also ensure
that we're not unpleasantly surprised when NotifyStart is called
the second time.

Signed-off-by: Klaus Aehlig <[email protected]>
---
 lib/jqueue/__init__.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lib/jqueue/__init__.py b/lib/jqueue/__init__.py
index f70bc48..ed999da 100644
--- a/lib/jqueue/__init__.py
+++ b/lib/jqueue/__init__.py
@@ -609,6 +609,17 @@ class _OpExecCallbacks(mcpu.OpExecCbBase):
     self._queue.UpdateJobUnlocked(self._job)
 
   @locking.ssynchronized(_QUEUE, shared=1)
+  def NotifyRetry(self):
+    """Mark opcode again as lock-waiting.
+
+    This is called from the mcpu code just after calling PrepareRetry.
+    The opcode will now again acquire locks (more, hopefully).
+
+    """
+    self._op.status = constants.OP_STATUS_WAITING
+    logging.debug("Opcode will be retried. Back to waiting.")
+
+  @locking.ssynchronized(_QUEUE, shared=1)
   def _AppendFeedback(self, timestamp, log_type, log_msg):
     """Internal feedback append function, with locks
 
-- 
2.1.0.rc2.206.gedb03e5

Reply via email to