As lock allocation is now inter-process communication, increase the minimal time we allow ourself for obtaining a lock. Also, increase polling frequency by an order of magnitude. The latter is safe, as we do not require on polling any more to get the locks assigned.
Signed-off-by: Klaus Aehlig <[email protected]> --- lib/mcpu.py | 4 ++-- src/Ganeti/Constants.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/mcpu.py b/lib/mcpu.py index 3c33ea6..33fd50d 100644 --- a/lib/mcpu.py +++ b/lib/mcpu.py @@ -401,14 +401,14 @@ class Processor(object): pending = self.wconfd.Client().HasPendingRequest(self._wconfdcontext) if not pending: break - time.sleep(random.random()) + time.sleep(10.0 * random.random()) else: logging.debug("Trying %ss to request %s for %s", timeout, request, self._wconfdcontext) # TODO: use correct priority instead of 0 self.wconfd.Client().UpdateLocksWaiting(self._wconfdcontext, 0, request) pending = utils.SimpleRetry(False, self.wconfd.Client().HasPendingRequest, - 0.1, timeout, args=[self._wconfdcontext]) + 1.0, timeout, args=[self._wconfdcontext]) if pending: # drop the pending request and all locks potentially obtained in the # timne since the last poll. diff --git a/src/Ganeti/Constants.hs b/src/Ganeti/Constants.hs index 91759b8..fe80e2e 100644 --- a/src/Ganeti/Constants.hs +++ b/src/Ganeti/Constants.hs @@ -3409,10 +3409,10 @@ locksReplace = "replace" -- given that we start from the default priority level. lockAttemptsMaxwait :: Double -lockAttemptsMaxwait = 15.0 +lockAttemptsMaxwait = 75.0 lockAttemptsMinwait :: Double -lockAttemptsMinwait = 1.0 +lockAttemptsMinwait = 5.0 lockAttemptsTimeout :: Int lockAttemptsTimeout = (10 * 3600) `div` (opPrioDefault - opPrioHighest) -- 1.9.1.423.g4596e3a
