Bug 6504 - ToasterUI adds 'ready' message in log for scripts embedding builds with ToasterUI startup to prevent event loss
Summary: ToasterUI adds 'ready' message in log for scripts embedding builds with Toast...
Status: VERIFIED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 1.6.2
Hardware: x86 Multiple
: Medium+ major
Target Milestone: 1.7 M2
Assignee: Alexandru Damian
QA Contact: Mihail Stanciu
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-07-03 20:19 UTC by Dave Lerner
Modified: 2014-10-17 10:07 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Lerner 2014-07-03 20:19:50 UTC
Provide a synchronization message via the log that ToasterUi is ready to receive events so that scripts that include launching builds don't cause events to be lost.

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.

A patch is provided that suffices by logging a "ready" message which the invoking script can poll for before proceeding with a build.

This bug is blocking integration into the WindRiver build system where toaster could be stress tested.

==========================
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:
Comment 1 Alexandru Damian 2014-07-10 14:57:43 UTC
Patch submitted.
Comment 2 Mihail Stanciu 2014-10-17 10:07:24 UTC
Verified on master: ccf5a4d2342c4fd40e4e0b332ea7e34e0bf175d4