summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-23 11:09:07 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-23 11:09:07 +0000
commit56a92105fe6b779c69bccd44c2cff8f21cafdfbd (patch)
tree22d4d5c8b1d62cadab09a844d0bc1eaef5e54595 /bitbake
parentc0f0a8ee0cac5b6dd7c7a7e584309f862e49f536 (diff)
downloadpoky-56a92105fe6b779c69bccd44c2cff8f21cafdfbd.tar.gz
bitbake/cooker: Fix parsing failure zombie problem
When parsing if a SystemExit event is triggered, it causes the parsing thread to exit and the main process hangs waiting for it to finish indefintely. Add code to catch BaseExceptions and raise these with the main process gracefully instead of just hanging indefinitely with zombie processes. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 825c357988..ff16daf83f 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -948,6 +948,13 @@ class CookerExit(bb.event.Event):
948 def __init__(self): 948 def __init__(self):
949 bb.event.Event.__init__(self) 949 bb.event.Event.__init__(self)
950 950
951class ParsingFailure(Exception):
952 def __init__(self, realexception, recipe):
953 self.realexception = realexception
954 self.recipe = recipe
955 Exception.__init__(self, "Failure when parsing %s" % recipe)
956 self.args = (realexception, recipe)
957
951def parse_file(task): 958def parse_file(task):
952 filename, appends = task 959 filename, appends = task
953 try: 960 try:
@@ -955,6 +962,11 @@ def parse_file(task):
955 except Exception, exc: 962 except Exception, exc:
956 exc.recipe = filename 963 exc.recipe = filename
957 raise exc 964 raise exc
965 # Need to turn BaseExceptions into Exceptions here so we gracefully shutdown
966 # and for example a worker thread doesn't just exit on its own in response to
967 # a SystemExit event for example.
968 except BaseException, exc:
969 raise ParsingFailure(exc, filename)
958 970
959class CookerParser(object): 971class CookerParser(object):
960 def __init__(self, cooker, filelist, masked): 972 def __init__(self, cooker, filelist, masked):