diff --git a/daemons/ganeti-noded b/daemons/ganeti-noded index 3de30d3683cdf2ad13ee4544089f15b3af15a999..bf00936e89396638cb59a655fed82ded34e21bb4 100755 --- a/daemons/ganeti-noded +++ b/daemons/ganeti-noded @@ -52,14 +52,17 @@ def _RequireJobQueueLock(fn): """Decorator for job queue manipulating functions. """ + QUEUE_LOCK_TIMEOUT = 10 + def wrapper(*args, **kwargs): # Locking in exclusive, blocking mode because there could be several # children running at the same time. Waiting up to 10 seconds. - queue_lock.Exclusive(blocking=True, timeout=10) + queue_lock.Exclusive(blocking=True, timeout=QUEUE_LOCK_TIMEOUT) try: return fn(*args, **kwargs) finally: queue_lock.Unlock() + return wrapper