From 506cff125c1d1583b48729c03a68e3c5af48cd0f Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Tue, 9 Sep 2008 09:01:53 +0000
Subject: [PATCH] Use lock timeout for queue updates in ganeti-noded

This helps to prevent complete deadlocks.

Reviewed-by: iustinp
---
 daemons/ganeti-noded | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/daemons/ganeti-noded b/daemons/ganeti-noded
index 9a360e6a4..59b3c3400 100755
--- a/daemons/ganeti-noded
+++ b/daemons/ganeti-noded
@@ -54,9 +54,8 @@ def _RequireJobQueueLock(fn):
   """
   def wrapper(*args, **kwargs):
     # Locking in exclusive, blocking mode because there could be several
-    # children running at the same time.
-    # TODO: Implement nonblocking locking with retries?
-    queue_lock.Exclusive(blocking=True)
+    # children running at the same time. Waiting up to 10 seconds.
+    queue_lock.Exclusive(blocking=True, timeout=10)
     try:
       return fn(*args, **kwargs)
     finally:
-- 
GitLab