[bitbake-devel,3/4] server/process: Ensure we don't keep looping if some other server is started
Submitted by Richard Purdie on Sept. 4, 2020, 2:44 p.m.
|
Patch ID: 176049
Details
Commit Message
@@ -266,10 +266,21 @@ class ProcessServer():
# Finally release the lockfile but warn about other processes holding it open
lock = self.bitbake_lock
lockfile = self.bitbake_lock_name
+ with open(lockfile, "r") as f:
+ lockcontents = f.readlines()
+
lock.close()
lock = None
while not lock:
+ try:
+ with open(lockfile, "r") as f:
+ lockcontents2 = f.readlines()
+ except FileNotFoundError:
+ return
+ if lockcontents2 != lockcontents:
+ # A new server was started, the lockfile contents changed, we can exit
+ return
i = 0
lock = None
while not lock and i < 30:
Shwoing "leftover process" messages when a new server has started and is being used by some UI is horrible. Compare the PID data from the lockfile to avoid this (and the ton of confusing log data it generates). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> --- lib/bb/server/process.py | 11 +++++++++++ 1 file changed, 11 insertions(+)