[oe-commits] [openembedded-core] 04/29: devtool: fix handling of errors during task execution

git at git.openembedded.org git at git.openembedded.org
Tue Aug 8 15:39:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 65e644368fc9c294af96906528ee0cf30305e0a6
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Mon Aug 7 12:03:44 2017 +0200

    devtool: fix handling of errors during task execution
    
    * If an error is logged while executing a task, we need to ensure we
      exit instead of assuming everything went OK.
    * If we receive CookerExit, the server is shutting down and we need to
      stop waiting for events and probably exit (knotty does this). This
      will occur if an exception or bb.fatal() happens during an event
      handler.
    
    This fixes a couple of issues highlighted when using devtool upgrade or
    modify on a non-supported recipe with intel-iot-refkit together with
    bitbake master, but I'd be very surprised if it were hard to reproduce
    in other scenarios.
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 scripts/lib/devtool/standard.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 22a9ec8..ec19223 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -498,18 +498,24 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d, tinfoil):
                                 'logging.LogRecord',
                                 'bb.command.CommandCompleted',
                                 'bb.command.CommandFailed',
+                                'bb.cooker.CookerExit',
                                 'bb.build.TaskStarted',
                                 'bb.build.TaskSucceeded',
                                 'bb.build.TaskFailed',
                                 'bb.build.TaskFailedSilent'])
 
         def runtask(target, task):
+            error = False
             if tinfoil.build_file(target, task):
                 while True:
                     event = tinfoil.wait_event(0.25)
                     if event:
                         if isinstance(event, bb.command.CommandCompleted):
                             break
+                        elif isinstance(event, bb.cooker.CookerExit):
+                            # The server is going away, so drop the connection
+                            tinfoil.server_connection = None
+                            break
                         elif isinstance(event, bb.command.CommandFailed):
                             raise DevtoolError('Task do_%s failed: %s' % (task, event.error))
                         elif isinstance(event, bb.build.TaskFailed):
@@ -519,7 +525,11 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d, tinfoil):
                         elif isinstance(event, logging.LogRecord):
                             if event.levelno <= logging.INFO:
                                 continue
+                            if event.levelno >= logging.ERROR:
+                                error = True
                             logger.handle(event)
+                if error:
+                    raise DevtoolError('An error occurred during do_%s, exiting' % task)
 
         # we need virtual:native:/path/to/recipe if it's a BBCLASSEXTEND
         fn = tinfoil.get_recipe_file(pn)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list