<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>6504</bug_id>
          
          <creation_ts>2014-07-03 20:19:50 +0000</creation_ts>
          <short_desc>ToasterUI adds &apos;ready&apos; message in log for scripts embedding builds with ToasterUI startup to prevent event loss</short_desc>
          <delta_ts>2014-10-17 10:07:24 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Toaster</product>
          <component>toaster</component>
          <version>1.6.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>1.7 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dave Lerner">dave.lerner</reporter>
          <assigned_to name="Alexandru Damian">alexandru.damian</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>alexandru.damian</cc>
    
    <cc>belen.barros.pena</cc>
    
    <cc>cristiana.voicu</cc>
          
          <qa_contact name="Mihail Stanciu">stanciux.mihail</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>44329</commentid>
    <comment_count>0</comment_count>
    <who name="Dave Lerner">dave.lerner</who>
    <bug_when>2014-07-03 20:19:50 +0000</bug_when>
    <thetext>Provide a synchronization message via the log that ToasterUi is ready to receive events so that scripts that include launching builds don&apos;t cause events to be lost.

It was observed that a sequence in a script such as
       bitbake --server-only ..
       bitbake --observe-only ..
       bitbake &lt;some target&gt;
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 &quot;ready&quot; 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 &quot;ready&quot; 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(&quot;ToasterUI waiting for events&quot;)

             if event is None:
                 if main.shutdown &gt; 0:</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44421</commentid>
    <comment_count>1</comment_count>
    <who name="Alexandru Damian">alexandru.damian</who>
    <bug_when>2014-07-10 14:57:43 +0000</bug_when>
    <thetext>Patch submitted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46408</commentid>
    <comment_count>2</comment_count>
    <who name="Mihail Stanciu">stanciux.mihail</who>
    <bug_when>2014-10-17 10:07:24 +0000</bug_when>
    <thetext>Verified on master: ccf5a4d2342c4fd40e4e0b332ea7e34e0bf175d4</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>