Skip to contentSkip to conversation

bitbake-worker: Improve error handling

PATCH New Richard Purdie 1 participant 1 message Sep 15, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 bin/bitbake-worker | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
bin/bitbake-worker +5 -3
index a9e33ca7c7..11f22c11fc 100755
@@ -512,9 +512,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)
Signature · 1 line
2.32.0