> -----Original Message----- > From: Damian, Alexandru [mailto:[email protected]] > Sent: Wednesday, June 18, 2014 11:03 AM > To: Lerner, Dave > Cc: [email protected] > Subject: Re: Patch for signaling ToasterUI is up and ready > > Got it, it is the same problem I've been facing. > > > I have got two other solutions for this: > > > - artificially wait 1 second after the "toaster start" command is given to > make sure the > observer settles. It's really poor design, and not bullet-proof but you don't > have to > monitor log files. This is employed right now with the toaster build control > module. >
The 1 (or in my tests 3) second solution was my diagnostic, but is problematic. What if the host has a high load, what if the toasterui code has additional startup added, what if the host is slow? But your next suggestion works for me! > - bitbake can be run directly with the toaster UI specified, and so you do > not have to > manually start the observer. I tried to modify toaster start to run the > observer in the > same command, but it involves some tricky logic for sending it into > background after the > connection is confirmed, so you can issue new commands, and not run into the > race > condition. this is still in the works. > That is a better solution! > Meanwhile I'll take in your patch as to move things forward. Thanks. Dave > > > Alex > > > > On Wed, Jun 18, 2014 at 4:14 PM, Lerner, Dave <[email protected]> > wrote: > > > Hi Alex, > The commit is an internal commit to our repos, not a commit in a Poky > repo. > -Dave > > commit 6a390954d1e6b92d82fea86b8041d6c8489c25ff > Author: Dave Lerner <[email protected]> > Date: Tue Jun 17 14:34:48 2014 -0500 > > Show in the log that ToasterUi is ready to receive events. > > Issue: TA53702 > > It was observed that a sequence in a script such as > bitbake --server-only .. > bitbake --observe-only .. > bitbake <some target> > could generate events from the server to the observer before > the observer was ready to read the events, and the early events > of builds were consistently dropped. Adding a "ready" note in the > log allows the script to scan for that message before proceeding > to building a target. > > Upstream Status: Pending > Signed-off-by: Dave Lerner <[email protected]> > > diff --git a/lib/bb/ui/toasterui.py b/lib/bb/ui/toasterui.py > index b1c80cc..5f87a9d 100644 > --- a/lib/bb/ui/toasterui.py > +++ b/lib/bb/ui/toasterui.py > @@ -91,6 +91,7 @@ def main(server, eventHandler, params ): > errors = 0 > warnings = 0 > taskfailures = [] > + first = True > > buildinfohelper = BuildInfoHelper(server, build_history_enabled) > > @@ -98,6 +99,9 @@ def main(server, eventHandler, params ): > while True: > try: > event = eventHandler.waitEvent(0.25) > + if first: > + first = False > + logger.info("ToasterUI waiting for events") > > if event is None: > if main.shutdown > 0: > > > > > > -- > > Alex Damian > Yocto Project > > SSG / OTC -- _______________________________________________ toaster mailing list [email protected] https://lists.yoctoproject.org/listinfo/toaster
