Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] A couple of fixes related to the server rework
@ 2017-08-07 10:03 Paul Eggleton
  2017-08-07 10:03 ` [PATCH 1/2] bitbake.conf: whitelist BB_SERVER_TIMEOUT from config hash Paul Eggleton
  2017-08-07 10:03 ` [PATCH 2/2] devtool: fix handling of errors during task execution Paul Eggleton
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Eggleton @ 2017-08-07 10:03 UTC (permalink / raw)
  To: openembedded-core

A couple of fixes for issues I've noticed when working with the newly
reworked server code in bitbake. 

Note: patch 2/2 also requires the revert I just sent to bitbake-devel
in order to fully resolve the issue.


The following changes since commit a5bb13a5d7d7a668ca61da6b17884e3b05b95355:

  python: don't include -tests with modules (2017-08-03 11:14:04 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib paule/server-fixes
  http://cgit.openembedded.org/openembedded-core-contrib/log/?h=paule/server-fixes

Paul Eggleton (2):
  bitbake.conf: whitelist BB_SERVER_TIMEOUT from config hash
  devtool: fix handling of errors during task execution

 meta/conf/bitbake.conf          |  2 +-
 scripts/lib/devtool/standard.py | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

-- 
2.9.4



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] bitbake.conf: whitelist BB_SERVER_TIMEOUT from config hash
  2017-08-07 10:03 [PATCH 0/2] A couple of fixes related to the server rework Paul Eggleton
@ 2017-08-07 10:03 ` Paul Eggleton
  2017-08-07 10:03 ` [PATCH 2/2] devtool: fix handling of errors during task execution Paul Eggleton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2017-08-07 10:03 UTC (permalink / raw)
  To: openembedded-core

We don't need to reparse recipes just because BB_SERVER_TIMEOUT changed,
so exclude it from the config hash.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/conf/bitbake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 9a3aa8b..3110b9c 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -850,7 +850,7 @@ BB_HASHCONFIG_WHITELIST ?= "${BB_HASHBASE_WHITELIST} DATE TIME SSH_AGENT_PID \
     PARALLEL_MAKE BB_NUMBER_THREADS BB_ORIGENV BB_INVALIDCONF BBINCLUDED \
     GIT_PROXY_COMMAND ALL_PROXY all_proxy NO_PROXY no_proxy FTP_PROXY ftp_proxy \
     HTTP_PROXY http_proxy HTTPS_PROXY https_proxy SOCKS5_USER SOCKS5_PASSWD \
-    BB_SETSCENE_ENFORCE BB_CMDLINE"
+    BB_SETSCENE_ENFORCE BB_CMDLINE BB_SERVER_TIMEOUT"
 BB_SIGNATURE_EXCLUDE_FLAGS ?= "doc deps depends \
     lockfiles type vardepsexclude vardeps vardepvalue vardepvalueexclude \
     file-checksums python func task export unexport noexec nostamp dirs cleandirs \
-- 
2.9.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] devtool: fix handling of errors during task execution
  2017-08-07 10:03 [PATCH 0/2] A couple of fixes related to the server rework Paul Eggleton
  2017-08-07 10:03 ` [PATCH 1/2] bitbake.conf: whitelist BB_SERVER_TIMEOUT from config hash Paul Eggleton
@ 2017-08-07 10:03 ` Paul Eggleton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2017-08-07 10:03 UTC (permalink / raw)
  To: openembedded-core

* 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@linux.intel.com>
---
 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)
-- 
2.9.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-07 10:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-07 10:03 [PATCH 0/2] A couple of fixes related to the server rework Paul Eggleton
2017-08-07 10:03 ` [PATCH 1/2] bitbake.conf: whitelist BB_SERVER_TIMEOUT from config hash Paul Eggleton
2017-08-07 10:03 ` [PATCH 2/2] devtool: fix handling of errors during task execution Paul Eggleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox