From ba06c29f117af41a9770e83cbf1b76bbb28cb34b Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 15 Sep 2021 10:31:56 +0100 Subject: [PATCH] bitbake: 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] (Bitbake rev: 97541440e982848ef8bdbced22decdc24eda855b) Signed-off-by: Richard Purdie (cherry picked from commit 7e0af70fb53fb13f824ca954b8cc1dffee730233) Signed-off-by: Steve Sakoman Signed-off-by: Richard Purdie --- bitbake/bin/bitbake-worker | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker index 97cc0fd60f..9ef0d5a683 100755 --- a/bitbake/bin/bitbake-worker +++ b/bitbake/bin/bitbake-worker @@ -505,9 +505,11 @@ except BaseException as e: import traceback sys.stderr.write(traceback.format_exc()) sys.stderr.write(str(e)) +finally: + worker_thread_exit = True + worker_thread.join() -worker_thread_exit = True -worker_thread.join() - -workerlog_write("exitting") +workerlog_write("exiting") +if not normalexit: + sys.exit(1) sys.exit(0)