From 8785cb30d2ad06ebf9ec793f0cabc1aec6359a17 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Tue, 9 Sep 2008 12:57:15 +0000 Subject: [PATCH] ganeti-noded: Add constant for queue lock timeout Reviewed-by: iustinp --- daemons/ganeti-noded | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daemons/ganeti-noded b/daemons/ganeti-noded index 3de30d368..bf00936e8 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 -- GitLab