@@ -362,20 +362,21 @@ class ProcessServer():
except FileNotFoundError:
return None
- lockcontents = get_lock_contents(lockfile)
- serverlog("Original lockfile contents: " + str(lockcontents))
-
lock.close()
lock = None
while not lock:
i = 0
lock = None
+ if not os.path.exists(os.path.basename(lockfile)):
+ serverlog("Lockfile directory gone, exiting.")
+ return
+
while not lock and i < 30:
lock = bb.utils.lockfile(lockfile, shared=False, retry=False, block=False)
if not lock:
newlockcontents = get_lock_contents(lockfile)
- if newlockcontents != lockcontents:
+ if not newlockcontents.startswith([os.getpid() + "\n", os.getpid() + " "]):
# A new server was started, the lockfile contents changed, we can exit
serverlog("Lockfile now contains different contents, exiting: " + str(newlockcontents))
return
If memory resident bitbake is active and the build directory is renamed upon build completion, several bad things can happen: * the old build directory could be re-created to contain a lockfile leaving an empty directory behind * a lockfile for a new build could be found and attempt to be locked This patch avoids creating an empty directory (not perfectly, but should work in the majority of cases - an empty directory is cosmetic). It also now compares the lock file contents to it's own pid and just exits if it doesn't match, it is clearly then belonging to some new process. This will be combined with bitbake shutdown calls on the autobuilder to ensure "saved" build directories, or build directories being deleted by clobberdir don't do strange things. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> --- lib/bb/server/process.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)