summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-18 10:21:34 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-18 10:23:13 +0000
commit6bbb179cc526c86631dfcb140e3dd51a8c07a52d (patch)
tree00f4d0abd45e85e5729a74fbb283bc22797ee11f
parent1f16ca9fba325f5ddbb1edad5bbad78d990de5e0 (diff)
downloadpoky-6bbb179cc526c86631dfcb140e3dd51a8c07a52d.tar.gz
bitbake: runqueue: More carefully handle the sigchld handler
We've noticed hanging processes which appear to be looping around waitpid. Its possible multiple calls to teardown are causing problem or in theory multiple registrations (although the code should not allow that). Regardless, put better guards around signal handler registration. (Bitbake rev: 79acfb0853aa3215215cee89a945f8e97b0a8fae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/runqueue.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 3c72b60f50..e8dfb394cd 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -937,8 +937,9 @@ class RunQueue:
937 if self.worker: 937 if self.worker:
938 self.teardown_workers() 938 self.teardown_workers()
939 self.teardown = False 939 self.teardown = False
940 self.oldsigchld = signal.getsignal(signal.SIGCHLD) 940 if not self.oldsigchld:
941 signal.signal(signal.SIGCHLD, self.sigchild_exception) 941 self.oldsigchld = signal.getsignal(signal.SIGCHLD)
942 signal.signal(signal.SIGCHLD, self.sigchild_exception)
942 self.worker, self.workerpipe = self._start_worker() 943 self.worker, self.workerpipe = self._start_worker()
943 944
944 def start_fakeworker(self, rqexec): 945 def start_fakeworker(self, rqexec):
@@ -949,6 +950,7 @@ class RunQueue:
949 self.teardown = True 950 self.teardown = True
950 if self.oldsigchld: 951 if self.oldsigchld:
951 signal.signal(signal.SIGCHLD, self.oldsigchld) 952 signal.signal(signal.SIGCHLD, self.oldsigchld)
953 self.oldsigchld = None
952 self._teardown_worker(self.worker, self.workerpipe) 954 self._teardown_worker(self.worker, self.workerpipe)
953 self.worker = None 955 self.worker = None
954 self.workerpipe = None 956 self.workerpipe = None