From 6ef9c0ef0e22edd0cce0bc6e9d89ccf429d22794 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 26 Jul 2019 16:50:27 -0500 Subject: [PATCH] Do not wait indefinitely for cache lock to get released --- pyopencl/cache.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyopencl/cache.py b/pyopencl/cache.py index fd46dc5c..b6d21f28 100644 --- a/pyopencl/cache.py +++ b/pyopencl/cache.py @@ -106,6 +106,11 @@ class CacheLockManager(CleanupBase): warn("could not obtain cache 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) def clean_up(self): -- GitLab