summaryrefslogtreecommitdiff
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)
downloadopenembedded-core-56a92105fe6b779c69bccd44c2cff8f21cafdfbd.tar.gz
openembedded-core-56a92105fe6b779c69bccd44c2cff8f21cafdfbd.tar.bz2
openembedded-core-56a92105fe6b779c69bccd44c2cff8f21cafdfbd.tar.xz
openembedded-core-56a92105fe6b779c69bccd44c2cff8f21cafdfbd.zip
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 825c35798..ff16daf83 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -948,6 +948,13 @@ class CookerExit(bb.event.Event):
def __init__(self):
bb.event.Event.__init__(self)
+class ParsingFailure(Exception):
+ def __init__(self, realexception, recipe):
+ self.realexception = realexception
+ self.recipe = recipe
+ Exception.__init__(self, "Failure when parsing %s" % recipe)
+ self.args = (realexception, recipe)
+
def parse_file(task):
filename, appends = task
try:
@@ -955,6 +962,11 @@ def parse_file(task):
except Exception, exc:
exc.recipe = filename
raise exc
+ # Need to turn BaseExceptions into Exceptions here so we gracefully shutdown
+ # and for example a worker thread doesn't just exit on its own in response to
+ # a SystemExit event for example.
+ except BaseException, exc:
+ raise ParsingFailure(exc, filename)
class CookerParser(object):
def __init__(self, cooker, filelist, masked):