aboutsummaryrefslogtreecommitdiffstats
path: root/bin/bitbake-worker
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-15 10:31:56 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-16 09:50:56 +0100
commit7e0af70fb53fb13f824ca954b8cc1dffee730233 (patch)
tree789ec464e3cb3dc8081e58de70059169d134bb6c /bin/bitbake-worker
parent9e56710c7203b1ec6cbefa758c81b69b697fe1a4 (diff)
downloadbitbake-7e0af70fb53fb13f824ca954b8cc1dffee730233.tar.gz
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin/bitbake-worker')
-rwxr-xr-xbin/bitbake-worker8
1 files 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)