From 7e0af70fb53fb13f824ca954b8cc1dffee730233 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 15 Sep 2021 10:31:56 +0100 Subject: bitbake-worker: Improve error handling If bitbake-worker fails, return an error code showing that. Also make the thread cleanup code explict in a finally clause as it would otherwise hang. [YOCTO #14393] Signed-off-by: Richard Purdie --- bin/bitbake-worker | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/bitbake-worker b/bin/bitbake-worker index 7d982f90b..3ca8c1853 100755 --- a/bin/bitbake-worker +++ b/bin/bitbake-worker @@ -513,9 +513,11 @@ except BaseException as e: import traceback sys.stderr.write(traceback.format_exc()) sys.stderr.write(str(e)) - -worker_thread_exit = True -worker_thread.join() +finally: + worker_thread_exit = True + worker_thread.join() workerlog_write("exiting") +if not normalexit: + sys.exit(1) sys.exit(0) -- cgit 1.2.3-korg