summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-21 21:47:25 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-23 09:31:42 +0100
commit8683c244c1c815dfab15e6cf67f17bb5d82505ef (patch)
treee2fa3d401cedbe1e4ba4b08ba628f985b5f4411c /bitbake
parentecf72a71320582cf8cd2d398c3653f432effb35d (diff)
downloadpoky-8683c244c1c815dfab15e6cf67f17bb5d82505ef.tar.gz
bitbake: utils: Add workaround for multiprocessing bug
Our usage of multitprocessing is problematic. In particular, there is a bug in python 2.7 multiprocessing where signals are not handled until command completion instead of immediately. This adds a workaround into our wrapper function to deal with the issue. (Bitbake rev: a16185e602b39b71475aa7e9ee80ad2b1f28d0f7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/utils.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index f62709bed5..4c894cbb0c 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -884,5 +884,17 @@ def process_profilelog(fn):
884# Was present to work around multiprocessing pool bugs in python < 2.7.3 884# Was present to work around multiprocessing pool bugs in python < 2.7.3
885# 885#
886def multiprocessingpool(*args, **kwargs): 886def multiprocessingpool(*args, **kwargs):
887
888 import multiprocessing.pool
889 #import multiprocessing.util
890 #multiprocessing.util.log_to_stderr(10)
891 # Deal with a multiprocessing bug where signals to the processes would be delayed until the work
892 # completes. Putting in a timeout means the signals (like SIGINT/SIGTERM) get processed.
893 def wrapper(func):
894 def wrap(self, timeout=None):
895 return func(self, timeout=timeout if timeout is not None else 1e100)
896 return wrap
897 multiprocessing.pool.IMapIterator.next = wrapper(multiprocessing.pool.IMapIterator.next)
898
887 return multiprocessing.Pool(*args, **kwargs) 899 return multiprocessing.Pool(*args, **kwargs)
888 900