summaryrefslogtreecommitdiffstats
path: root/bin/bitbake-worker
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-09 22:44:37 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-09 22:45:40 +0100
commit60f6c2818f38c4d9c2d9aaa42acf3071636f4a3b (patch)
treefc2080d68e90c8a2efa07d1ced0afa7577c18ba4 /bin/bitbake-worker
parent224ee3685fe20915b21d299ab80f7b289a916dca (diff)
downloadbitbake-contrib-60f6c2818f38c4d9c2d9aaa42acf3071636f4a3b.tar.gz
bitbake-worker: Ensure pipe closure doesn't crash before killpg()
If the pipe is closed, we want to ensure that we kill any child processes by triggering the sigterm handler before we exit. This code does that, hopefully avoiding the remaining process left behind issues on the autobuilder. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin/bitbake-worker')
-rwxr-xr-xbin/bitbake-worker6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/bitbake-worker b/bin/bitbake-worker
index 5f6543b7e..af17b874a 100755
--- a/bin/bitbake-worker
+++ b/bin/bitbake-worker
@@ -87,7 +87,11 @@ def worker_child_fire(event, d):
global worker_pipe
data = "<event>" + pickle.dumps(event) + "</event>"
- worker_pipe.write(data)
+ try:
+ worker_pipe.write(data)
+ except IOError:
+ sigterm_handler(None, None)
+ raise
bb.event.worker_fire = worker_fire