All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Jan Kiszka <jan.kiszka@siemens.com>,
	bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH] process: Flush server stdout/stderr before reporting failure
Date: Tue, 04 Sep 2018 13:34:29 +0100	[thread overview]
Message-ID: <f22cc8eccc5b47a29c87de3b6ad9193d22f486b6.camel@linuxfoundation.org> (raw)
In-Reply-To: <2ba43936a9d6d2a1baac49c419cdc5c86cbbdbf1.camel@linuxfoundation.org>

On Tue, 2018-09-04 at 13:15 +0100, Richard Purdie wrote:
> On Sun, 2018-09-02 at 10:43 +0200, Jan Kiszka wrote:
> > We need to print exceptions and flush output channels before
> > telling
> > the
> > client that the server failed. Otherwise the daemon log file may
> > still
> > be empty when the client opens it for printing.
> > 
> > This fixes error reporting when the output is redirected to a pipe,
> > e.g.
> > "bitbake target | cat" with a syntax error in a recipes or config
> > file.
> > That's specifically annoying when bitbake is under the control of a
> > frontend process such as kas.
> 
> Hi,
> 
> Could you check if this was already fixed by:
> 
> http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=cbe2d3cb0af6c7a5
> cd368e7dc489960a13648bd0
> 
> ?
> 
> I really want to get these flushes as close to the source of the
> problems as we can.

Looking at the code further, I suspect we should simply be doing:

        writer = ConnectionWriter(self.readypipein)
        self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset)
        writer.send("ready")
        os.close(self.readypipein)
        server.cooker = self.cooker

with no exception handling. The ready pipe would then get closed by the
os._exit() in daemonize which is after the flush. It simplifies the
code as an added bonus...

Cheers,

Richard


  reply	other threads:[~2018-09-04 12:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-02  8:43 [PATCH] process: Flush server stdout/stderr before reporting failure Jan Kiszka
2018-09-04 12:15 ` Richard Purdie
2018-09-04 12:34   ` Richard Purdie [this message]
2018-09-04 13:09     ` Jan Kiszka
2018-09-05  0:14       ` richard.purdie
2018-09-07  9:48         ` Jan Kiszka

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=f22cc8eccc5b47a29c87de3b6ad9193d22f486b6.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=jan.kiszka@siemens.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.