aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-04 15:39:03 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-05 11:45:10 +0100
commitb100d22ce37b7548b50e59a71802bcc903acd6ea (patch)
tree53c20fe6111df4b1ce524d8b03476ce49cc1f7e8
parentd95c3dd2b8ac50423976a7baf0a51e9580871761 (diff)
downloadbitbake-b100d22ce37b7548b50e59a71802bcc903acd6ea.tar.gz
server/process: Don't show tracebacks if the lockfile is removed
lsof/fuser error if the file doesn't exist. It can be deleted by something else so ignore this if it happens and loop. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/server/process.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 2be4588a4..f794505fd 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -286,6 +286,9 @@ class ProcessServer():
procs = None
try:
procs = subprocess.check_output(["lsof", '-w', lockfile], stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError:
+ # File was deleted?
+ continue
except OSError as e:
if e.errno != errno.ENOENT:
raise
@@ -293,6 +296,9 @@ class ProcessServer():
# Fall back to fuser if lsof is unavailable
try:
procs = subprocess.check_output(["fuser", '-v', lockfile], stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError:
+ # File was deleted?
+ continue
except OSError as e:
if e.errno != errno.ENOENT:
raise