diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-09-15 10:31:56 +0100 |
---|---|---|
committer | Anuj Mittal <anuj.mittal@intel.com> | 2021-09-24 15:03:33 +0800 |
commit | 0637703046d3f3f7d3bfdd1e5ecb524440897c35 (patch) | |
tree | 122a9329b0f0766374e9ee8c5081ba63ff399608 | |
parent | 284ca139b3a2ce61cef91b3076fd8bb544461c16 (diff) | |
download | bitbake-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>
-rwxr-xr-x | bin/bitbake-worker | 8 |
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) |