All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] bitbake: runqueue/cooker: catch hashvalidate error
@ 2015-04-10  8:44 Robert Yang
  2015-04-10  8:44 ` [PATCH 1/1] bitbake: runqueue/cooker: catch hashvalidate error in RunQueueExecuteScenequeue Robert Yang
  2015-07-01  3:24 ` [PATCH 0/1] bitbake: runqueue/cooker: catch hashvalidate error Robert Yang
  0 siblings, 2 replies; 3+ messages in thread
From: Robert Yang @ 2015-04-10  8:44 UTC (permalink / raw)
  To: bitbake-devel

*** BLURB HERE ***
The following changes since commit 6ebeae9b2011050c318a764e980bc47e51cc2d74:

  tiff: remove extra dev and dbg from PACKAGES (2015-04-10 01:24:01 -0700)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib rbt/hx
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=rbt/hx

Hongxu Jia (1):
  bitbake: runqueue/cooker: catch hashvalidate error in
    RunQueueExecuteScenequeue

 bitbake/lib/bb/cooker.py   |    4 ++--
 bitbake/lib/bb/runqueue.py |   14 ++++++++------
 2 files changed, 10 insertions(+), 8 deletions(-)

-- 
1.7.9.5



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

* [PATCH 1/1] bitbake: runqueue/cooker: catch hashvalidate error in RunQueueExecuteScenequeue
  2015-04-10  8:44 [PATCH 0/1] bitbake: runqueue/cooker: catch hashvalidate error Robert Yang
@ 2015-04-10  8:44 ` Robert Yang
  2015-07-01  3:24 ` [PATCH 0/1] bitbake: runqueue/cooker: catch hashvalidate error Robert Yang
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Yang @ 2015-04-10  8:44 UTC (permalink / raw)
  To: bitbake-devel

From: Hongxu Jia <hongxu.jia@windriver.com>

We need to catch the failure of self.rq.hashvalidate which invoked
in RunQueueExecuteScenequeue, and exit in a normal build. So we
raise bb.BBHandledException for this specific error.

Tweak execute_runqueue's exception process order. So the build will
exit peacefully while the above failure occurs.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 bitbake/lib/bb/cooker.py   |    4 ++--
 bitbake/lib/bb/runqueue.py |   14 ++++++++------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 9c101f2..6762239 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1298,7 +1298,7 @@ class BBCooker:
             except runqueue.TaskFailure as exc:
                 failures += len(exc.args)
                 retval = False
-            except SystemExit as exc:
+            except (SystemExit, bb.BBHandledException) as exc:
                 self.command.finishAsyncCommand()
                 return False
 
@@ -1331,7 +1331,7 @@ class BBCooker:
             except runqueue.TaskFailure as exc:
                 failures += len(exc.args)
                 retval = False
-            except SystemExit as exc:
+            except (SystemExit, bb.BBHandledException) as exc:
                 self.command.finishAsyncCommand()
                 return False
 
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index b1fe6b8..cd63ba7 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1094,10 +1094,9 @@ class RunQueue:
             return self._execute_runqueue()
         except bb.runqueue.TaskFailure:
             raise
-        except SystemExit:
-            raise
-        except:
-            logger.error("An uncaught exception occured in runqueue, please see the failure below:")
+        except BaseException as e:
+            if not isinstance(e, (SystemExit, bb.BBHandledException)):
+                logger.error("An uncaught exception occured in runqueue, please see the failure below:")
             try:
                 self.teardown_workers()
             except:
@@ -1821,7 +1820,11 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
                 sq_task.append(task)
             call = self.rq.hashvalidate + "(sq_fn, sq_task, sq_hash, sq_hashfn, d)"
             locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname, "sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.expanded_data }
-            valid = bb.utils.better_eval(call, locs)
+            try:
+                valid = bb.utils.better_eval(call, locs)
+            except Exception as e:
+                logger.error("Hash validation failed in RunQueueExecuteScenequeue %s" % str(e))
+                raise bb.BBHandledException()
 
             valid_new = stamppresent
             for v in valid:
@@ -2007,7 +2010,6 @@ class TaskFailure(Exception):
     def __init__(self, x):
         self.args = x
 
-
 class runQueueExitWait(bb.event.Event):
     """
     Event when waiting for task processes to exit
-- 
1.7.9.5



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

* Re: [PATCH 0/1] bitbake: runqueue/cooker: catch hashvalidate error
  2015-04-10  8:44 [PATCH 0/1] bitbake: runqueue/cooker: catch hashvalidate error Robert Yang
  2015-04-10  8:44 ` [PATCH 1/1] bitbake: runqueue/cooker: catch hashvalidate error in RunQueueExecuteScenequeue Robert Yang
@ 2015-07-01  3:24 ` Robert Yang
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Yang @ 2015-07-01  3:24 UTC (permalink / raw)
  To: bitbake-devel


Hi RP,

I rebased the code and put on:

git://git.pokylinux.org/poky-contrib rbt/hx

Do you have any comments, please ?

Author: Hongxu Jia <hongxu.jia@windriver.com>
Date:   Wed Aug 27 11:32:35 2014 +0800

     bitbake: runqueue/cooker: catch hashvalidate error in RunQueueExecuteScenequeue

     We need to catch the failure of self.rq.hashvalidate which invoked
     in RunQueueExecuteScenequeue, and exit in a normal build. So we
     raise bb.BBHandledException for this specific error.

     Tweak execute_runqueue's exception process order. So the build will
     exit peacefully while the above failure occurs.

     (LOCAL REV: NOT UPSTREAM) -- Sent to bitbake-devel on 20140827

     Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index f31bca6..304cd27 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1298,7 +1298,7 @@ class BBCooker:
              except runqueue.TaskFailure as exc:
                  failures += len(exc.args)
                  retval = False
-            except SystemExit as exc:
+            except (SystemExit, bb.BBHandledException) as exc:
                  self.command.finishAsyncCommand()
                  return False

@@ -1331,7 +1331,7 @@ class BBCooker:
              except runqueue.TaskFailure as exc:
                  failures += len(exc.args)
                  retval = False
-            except SystemExit as exc:
+            except (SystemExit, bb.BBHandledException) as exc:
                  self.command.finishAsyncCommand()
                  return False

diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 17a55d3..bd9f3b5 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1103,8 +1103,9 @@ class RunQueue:
                  pass
              self.state = runQueueComplete
              raise
-        except:
-            logger.error("An uncaught exception occured in runqueue, please see 
the failure below:")
+        except BaseException as e:
+            if not isinstance(e, (SystemExit, bb.BBHandledException)):
+                logger.error("An uncaught exception occured in runqueue, please 
see the failure below:")
              try:
                  self.teardown_workers()
              except:
@@ -1841,7 +1842,11 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
                  sq_task.append(task)
              call = self.rq.hashvalidate + "(sq_fn, sq_task, sq_hash, 
sq_hashfn, d)"
              locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname, "sq_hash" : 
sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.expanded_data }
-            valid = bb.utils.better_eval(call, locs)
+            try:
+                valid = bb.utils.better_eval(call, locs)
+            except Exception as e:
+                logger.error("Hash validation failed in 
RunQueueExecuteScenequeue %s" % str(e))
+                raise bb.BBHandledException()

              valid_new = stamppresent
              for v in valid:
@@ -2027,7 +2032,6 @@ class TaskFailure(Exception):
      def __init__(self, x):
          self.args = x

-
  class runQueueExitWait(bb.event.Event):
      """
      Event when waiting for task processes to exit



// Robert

On 04/10/2015 04:44 PM, Robert Yang wrote:
> *** BLURB HERE ***
> The following changes since commit 6ebeae9b2011050c318a764e980bc47e51cc2d74:
>
>    tiff: remove extra dev and dbg from PACKAGES (2015-04-10 01:24:01 -0700)
>
> are available in the git repository at:
>
>    git://git.pokylinux.org/poky-contrib rbt/hx
>    http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=rbt/hx
>
> Hongxu Jia (1):
>    bitbake: runqueue/cooker: catch hashvalidate error in
>      RunQueueExecuteScenequeue
>
>   bitbake/lib/bb/cooker.py   |    4 ++--
>   bitbake/lib/bb/runqueue.py |   14 ++++++++------
>   2 files changed, 10 insertions(+), 8 deletions(-)
>


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

end of thread, other threads:[~2015-07-01  3:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-10  8:44 [PATCH 0/1] bitbake: runqueue/cooker: catch hashvalidate error Robert Yang
2015-04-10  8:44 ` [PATCH 1/1] bitbake: runqueue/cooker: catch hashvalidate error in RunQueueExecuteScenequeue Robert Yang
2015-07-01  3:24 ` [PATCH 0/1] bitbake: runqueue/cooker: catch hashvalidate error Robert Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.