diff options
author | Shane Wang <shane.wang@intel.com> | 2012-03-30 17:12:41 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-30 17:20:21 +0100 |
commit | 984c23f7d7d18464a060aa66be7c02abb8266a08 (patch) | |
tree | 2d1d53c208ceb9493e85eb0916e8c503840af0ac /bitbake/lib/bb/runqueue.py | |
parent | 35acc9edc815b715582570ba4baec0909f2bb81b (diff) | |
download | poky-984c23f7d7d18464a060aa66be7c02abb8266a08.tar.gz |
runqueue: wait and deal with those <defunct> sub-processes as soon as they are os.killed() when "Force stop"
When "Force stop" is performed during the build stage, after os.kill() kills the build sub-processes, there are many <defunct> python processes in the system. In Hob, when the user initiates a new build, os.waitpid() in runqueue_process_waitpid() will be called, and the pids of those <defunct> processes will be returned as result[0], then self.build_pids[result[0]] will throw KeyError exception because now for the new build self.build_pids is empty.
This patch is to address the above issue to collect the results and handle the sub-processes as soon as they are killed.
[Yocto #2186]
(Bitbake rev: e9f4ca467e795bbc520d12b0e7a5985b6ff0a20e)
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 69705481a0..b870caff4e 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -1068,6 +1068,7 @@ class RunQueueExecute: | |||
1068 | for k, v in self.build_pids.iteritems(): | 1068 | for k, v in self.build_pids.iteritems(): |
1069 | try: | 1069 | try: |
1070 | os.kill(-k, signal.SIGTERM) | 1070 | os.kill(-k, signal.SIGTERM) |
1071 | os.waitpid(-1, 0) | ||
1071 | except: | 1072 | except: |
1072 | pass | 1073 | pass |
1073 | for pipe in self.build_pipes: | 1074 | for pipe in self.build_pipes: |