From 0ac647aa5f18e361341ceab11c0d4bf24a60f21c Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Sun, 2 Oct 2016 14:00:18 -0500 Subject: [PATCH] Add timeout to lock wait --- pytools/persistent_dict.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pytools/persistent_dict.py b/pytools/persistent_dict.py index 5ca6b91..c10d4e9 100644 --- a/pytools/persistent_dict.py +++ b/pytools/persistent_dict.py @@ -108,6 +108,10 @@ class LockManager(CleanupBase): from warnings import warn warn("could not obtain lock--delete '%s' if necessary" % self.lock_file) + if attempts > 3 * 60: + raise RuntimeError("waited more than three minutes " + "on the lock file '%s'" + "--something is wrong" % self.lock_file) cleanup_m.register(self) -- GitLab