[bitbake-devel] [PATCH] process: Flush server stdout/stderr before reporting failure

Richard Purdie richard.purdie at linuxfoundation.org
Tue Sep 4 12:34:29 UTC 2018


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



More information about the bitbake-devel mailing list