aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-15 10:31:56 +0100
committerAnuj Mittal <anuj.mittal@intel.com>2021-09-24 15:03:33 +0800
commit0637703046d3f3f7d3bfdd1e5ecb524440897c35 (patch)
tree122a9329b0f0766374e9ee8c5081ba63ff399608 /bin
parent284ca139b3a2ce61cef91b3076fd8bb544461c16 (diff)
downloadbitbake-0637703046d3f3f7d3bfdd1e5ecb524440897c35.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: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'bin')
-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)