summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/main.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-08 17:29:49 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-09 13:22:11 +0000
commita9505a86fdcd789093732b800ba08e7a23c21070 (patch)
tree9f270d04c91a63865d6e02365b8208a02fc10baf /bitbake/lib/bb/main.py
parent8aa083f842cc54fb7c0ef3ff8724fed2dff40d66 (diff)
downloadpoky-a9505a86fdcd789093732b800ba08e7a23c21070.tar.gz
bitbake: main/server: Add lockfile debugging upon server retry
We keep seeing server issues where the lockfile is present but we can't connect to it. Reuse the lockfile debugging code from the server to dump better information to the console from the client side when we run into this issue. Whilst not pretty, this might give us a chance of being able to debug the problems further. (Bitbake rev: 22685460b5ecb1aeb4ff3436088ecdacb43044d7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/main.py')
-rwxr-xr-xbitbake/lib/bb/main.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py
index 6294b85cfd..1e38d04bcf 100755
--- a/bitbake/lib/bb/main.py
+++ b/bitbake/lib/bb/main.py
@@ -422,7 +422,7 @@ def setup_bitbake(configParams, extrafeatures=None):
422 retries = 8 422 retries = 8
423 while retries: 423 while retries:
424 try: 424 try:
425 topdir, lock = lockBitbake() 425 topdir, lock, lockfile = lockBitbake()
426 sockname = topdir + "/bitbake.sock" 426 sockname = topdir + "/bitbake.sock"
427 if lock: 427 if lock:
428 if configParams.status_only or configParams.kill_server: 428 if configParams.status_only or configParams.kill_server:
@@ -439,12 +439,15 @@ def setup_bitbake(configParams, extrafeatures=None):
439 logger.info("Reconnecting to bitbake server...") 439 logger.info("Reconnecting to bitbake server...")
440 if not os.path.exists(sockname): 440 if not os.path.exists(sockname):
441 logger.info("Previous bitbake instance shutting down?, waiting to retry... (%s)" % timestamp()) 441 logger.info("Previous bitbake instance shutting down?, waiting to retry... (%s)" % timestamp())
442 procs = bb.server.process.get_lockfile_process_msg(lockfile)
443 if procs:
444 logger.info("Processes holding bitbake.lock:\n%s" % procs)
442 i = 0 445 i = 0
443 lock = None 446 lock = None
444 # Wait for 5s or until we can get the lock 447 # Wait for 5s or until we can get the lock
445 while not lock and i < 50: 448 while not lock and i < 50:
446 time.sleep(0.1) 449 time.sleep(0.1)
447 _, lock = lockBitbake() 450 _, lock, _ = lockBitbake()
448 i += 1 451 i += 1
449 if lock: 452 if lock:
450 bb.utils.unlockfile(lock) 453 bb.utils.unlockfile(lock)
@@ -494,5 +497,5 @@ def lockBitbake():
494 bb.error("Unable to find conf/bblayers.conf or conf/bitbake.conf. BBPATH is unset and/or not in a build directory?") 497 bb.error("Unable to find conf/bblayers.conf or conf/bitbake.conf. BBPATH is unset and/or not in a build directory?")
495 raise BBMainFatal 498 raise BBMainFatal
496 lockfile = topdir + "/bitbake.lock" 499 lockfile = topdir + "/bitbake.lock"
497 return topdir, bb.utils.lockfile(lockfile, False, False) 500 return topdir, bb.utils.lockfile(lockfile, False, False), lockfile
498 501