summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ybd/app.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/ybd/app.py b/ybd/app.py
index 36fbebc..1040ab3 100644
--- a/ybd/app.py
+++ b/ybd/app.py
@@ -41,10 +41,14 @@ class RetryException(Exception):
if config.get('last-retry-time'):
wait = datetime.datetime.now() - config.get('last-retry-time')
if wait.seconds < 1 and os.path.exists(lockfile(dn)):
- with open(lockfile(dn), 'r') as L:
- call(['flock', '--shared', '--timeout',
- config.get('timeout', '60'), str(L.fileno())])
- log(dn, 'Finished wait loop', verbose=True)
+ try:
+ with open(lockfile(dn), 'r') as L:
+ call(['flock', '--shared', '--timeout',
+ config.get('timeout', '60'), str(L.fileno())])
+ log(dn, 'Finished wait loop', verbose=True)
+ except IOError:
+ # The process that had the lock is finished with it.
+ pass
config['last-retry-time'] = datetime.datetime.now()
config['last-retry-dn'] = dn
for dirname in config['sandboxes']: