Openembedded Bitbake Development
 help / color / mirror / Atom feed
From: Hongxu Jia <hongxu.jia@windriver.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH 1/1] bitbake: runqueue: terminate build safely while RunQueueExecuteScenequeue init failed
Date: Wed, 27 Aug 2014 19:02:47 +0800	[thread overview]
Message-ID: <53FDBAD7.9010403@windriver.com> (raw)
In-Reply-To: <1409136574.5772.37.camel@ted>

On 08/27/2014 06:49 PM, Richard Purdie wrote:
> On Wed, 2014-08-27 at 18:44 +0800, Hongxu Jia wrote:
>> While RunQueueExecuteScenequeue init failed, the exit of build is mess.
>> Here is the example while bb.fatal invoked in RunQueueExecuteScenequeue:
>> ...
>> Traceback (most recent call last):
>> |  File "/home/jiahongxu/yocto/poky/bitbake/lib/bb/runqueue.py",
>>    line 1824, in RunQueueExecuteScenequeue.__init__(rq=<bb.runqueue.RunQueue
>>    instance at 0x7f87dd7d5050>):
>> |                 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)
>>
>> |    def better_eval(source, locals):
>> |    >    return eval(source, get_context(), locals)
>>
>> |  File "<string>", line 1, in <module>
>> |  File "/home/jiahongxu/yocto/poky/bitbake/lib/bb/__init__.py", line 102,
>>    in fatal:
>> |         logger.critical(''.join(args))
>> |    >    raise BBHandledException()
>>
>> BBHandledException
>> ...
>>
>> We should terminate build safely while RunQueueExecuteScenequeue init failed.
>>
>> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>> ---
>>   bitbake/lib/bb/runqueue.py | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
>> index e13dc57..c7b1dc0 100644
>> --- a/bitbake/lib/bb/runqueue.py
>> +++ b/bitbake/lib/bb/runqueue.py
>> @@ -1046,7 +1046,12 @@ class RunQueue:
>>                   self.state = runQueueComplete
>>               else:
>>                   self.start_worker()
>> -                self.rqexe = RunQueueExecuteScenequeue(self)
>> +                try:
>> +                    self.rqexe = RunQueueExecuteScenequeue(self)
>> +                except:
>> +                    # The RunQueueExecuteScenequeue init failure
>> +                    # terminated the build safely
>> +                    self.state = runQueueComplete
>>   
> If the init fails, shouldn't we show a traceback and exit with an error
> status? Does this happen in a normal build and if so, is there an
> underlying cause we should fix?

In my case, I want to catch the failure of self.rq.hashvalidate which
invoked in RunQueueExecuteScenequeue, and exit in a normal build.

>
> I'm worried this would let errors go unnoticed. Except clauses in
> general should catch specific errors not every exception so this really
> can't merge in this form, sorry.

Got it, I will add condition to catch the failure of self.rq.hashvalidate,
and don't affect other errors.

Thanks,
//Hongxu

> Cheers,
>
> Richard
>
>



  reply	other threads:[~2014-08-27 11:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 10:44 [PATCH V2 0/1] bitbake: runqueue: terminate build safely while RunQueueExecuteScenequeue init failed Hongxu Jia
2014-08-27 10:44 ` [PATCH 1/1] " Hongxu Jia
2014-08-27 10:49   ` Richard Purdie
2014-08-27 11:02     ` Hongxu Jia [this message]
2014-08-27 11:03 ` [PATCH V2 0/1] " Martin Jansa
  -- strict thread matches above, loose matches on Subject: below --
2014-08-27 10:27 [PATCH " Hongxu Jia
2014-08-27 10:27 ` [PATCH 1/1] " Hongxu Jia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53FDBAD7.9010403@windriver.com \
    --to=hongxu.jia@windriver.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox