]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake-worker: Ensure pipe closure doesn't crash before killpg()
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 9 Sep 2015 21:44:37 +0000 (22:44 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 9 Sep 2015 21:45:40 +0000 (22:45 +0100)
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>
bin/bitbake-worker

index 5f6543b7e9b7ad0906abe7e8af4f7a971aeca644..af17b874aa3460e48534f7de7887e1786cf62aab 100755 (executable)
@@ -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