aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-15 10:31:56 +0100
committerSteve Sakoman <steve@sakoman.com>2021-09-24 12:38:18 -1000
commit97541440e982848ef8bdbced22decdc24eda855b (patch)
tree433ceb9db4e7a610ada426160d617f8f7f039ece
parent7f7034a6a0893debd8a5288a5765146a8b2ab0a0 (diff)
downloadbitbake-contrib-97541440e982848ef8bdbced22decdc24eda855b.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> (cherry picked from commit 7e0af70fb53fb13f824ca954b8cc1dffee730233) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rwxr-xr-xbin/bitbake-worker10
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/bitbake-worker b/bin/bitbake-worker
index 97cc0fd60..9ef0d5a68 100755
--- a/bin/bitbake-worker
+++ b/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)