From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Hongxu Jia <hongxu.jia@windriver.com>
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 11:49:34 +0100 [thread overview]
Message-ID: <1409136574.5772.37.camel@ted> (raw)
In-Reply-To: <4ce3cc607c61c23904de8f3844e7e8b360375557.1409136202.git.hongxu.jia@windriver.com>
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?
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.
Cheers,
Richard
next prev parent reply other threads:[~2014-08-27 10:49 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 [this message]
2014-08-27 11:02 ` Hongxu Jia
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=1409136574.5772.37.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=bitbake-devel@lists.openembedded.org \
--cc=hongxu.jia@windriver.com \
/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 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.