[bitbake-devel] [PATCH 1/1] bitbake: runqueue: catch hashvalidate error in RunQueueExecuteScenequeue

Richard Purdie richard.purdie at linuxfoundation.org
Wed Aug 27 14:05:22 UTC 2014


On Wed, 2014-08-27 at 21:57 +0800, Hongxu Jia wrote:
> We need to catch the failure of self.rq.hashvalidate which invoked
> in RunQueueExecuteScenequeue, and exit in a normal build.
> 
> So we raise and except bb.BBHandledException for this specific error.
> 
> Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
> ---
>  bitbake/lib/bb/runqueue.py | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
> index e13dc57..59e4188 100644
> --- a/bitbake/lib/bb/runqueue.py
> +++ b/bitbake/lib/bb/runqueue.py
> @@ -1046,7 +1046,14 @@ class RunQueue:
>                  self.state = runQueueComplete
>              else:
>                  self.start_worker()
> -                self.rqexe = RunQueueExecuteScenequeue(self)
> +                try:
> +                    self.rqexe = RunQueueExecuteScenequeue(self)
> +                except bb.BBHandledException:
> +                    # While hashvalidate failed, we need exit the normal build.
> +                    self.state = runQueueComplete
> +                except:
> +                    logger.error("RunQueueExecuteScenequeue init failed")
> +                    raise

Do you still need to do this with the change below? runqueue didn't
complete, it failed so the state doesn't seem right...

Cheers,

Richard

>          if self.state in [runQueueSceneRun, runQueueRunning, runQueueCleanUp]:
>              self.dm.check(self)
> @@ -1821,7 +1828,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.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:
> @@ -2003,7 +2014,6 @@ class TaskFailure(Exception):
>      def __init__(self, x):
>          self.args = x
>  
> -
>  class runQueueExitWait(bb.event.Event):
>      """
>      Event when waiting for task processes to exit





More information about the bitbake-devel mailing list