bitbake: 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.

(Bitbake rev: b100d22ce37b7548b50e59a71802bcc903acd6ea)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2020-09-04 15:39:03 +01:00
parent f6a40d457c
commit 175e5f2702

View File

@@ -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