<?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>10330</bug_id>
          
          <creation_ts>2016-09-26 16:32:49 +0000</creation_ts>
          <short_desc>bitbake with memory resident don&apos;t report SSTATE progress</short_desc>
          <delta_ts>2016-10-05 15:08:41 +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>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>YP 2.2 M4 RC1 BUILD BLOCKING BUG</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.2 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Aníbal Limón">anibal.limon</reporter>
          <assigned_to name="Aníbal Limón">anibal.limon</assigned_to>
          <cc>anibal.limon</cc>
    
    <cc>bluelightning</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>66592</commentid>
    <comment_count>0</comment_count>
    <who name="Aníbal Limón">anibal.limon</who>
    <bug_when>2016-09-26 16:32:49 +0000</bug_when>
    <thetext>When try to use bitbake with memory resident and SSTATE_MIRRORs the sstate check object availability bar gets stalled at 3% and the build continues with background processes executing,

For reproduce this bug you need to config SSTATE_MIRRORs in local.conf.

$ source oe-init-build-env-memres
$ bitbake core-image-full-cmdline
Loading cache: 100% |############################################| Time: 0:00:01
Loaded 1316 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = &quot;1.31.1&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;universal&quot;
TARGET_SYS        = &quot;aarch64-poky-linux&quot;
MACHINE           = &quot;qemuarm64&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.1+snapshot-20160926&quot;
TUNE_FEATURES     = &quot;aarch64&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-poky         
meta-yocto-bsp    = &quot;alimon/simple_patches:725e66e1d08ae000d8f68455ddca0e192080dc1f&quot;

Initialising tasks: 100% |########################################################| Time: 0:00:06
Checking sstate mirror object availability:   1% |                                | ETA:  0:00:01</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66648</commentid>
    <comment_count>1</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2016-09-27 19:09:33 +0000</bug_when>
    <thetext>I tried twice launching the proposed commmands, first time it get stucks on 0% second time on 8%. One more thing: The issue is not observed with oe-init-build-env setup script so only affecting memres.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66802</commentid>
    <comment_count>2</comment_count>
    <who name="Jose Lamego">jose.a.lamego</who>
    <bug_when>2016-10-03 14:21:19 +0000</bug_when>
    <thetext>This seems to be a concurrency related problem: Progress bar behaves as expected if the fetch tests are forced to be run in a single thread (nproc = 1).
Need to find the relation between this behavior and the memory resident setting.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66855</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-10-04 09:44:26 +0000</bug_when>
    <thetext>I believe Anibal has made progress and this looks like a thread concurrency issue in bb.event.fire() and is related to how sstate is using threading.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66860</commentid>
    <comment_count>4</comment_count>
    <who name="Aníbal Limón">anibal.limon</who>
    <bug_when>2016-10-04 13:27:26 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; I believe Anibal has made progress and this looks like a thread concurrency
&gt; issue in bb.event.fire() and is related to how sstate is using threading.

Yes, i found that events are generated into the event.fire by the server but the client (UI) don&apos;t receive the ProgressEnd event. So the next patch fixes the issue but we need to discuss how to address it.

@@ -145,12 +145,17 @@ def print_ui_queue():
             if isinstance(event, logging.LogRecord):
                 logger.handle(event)
 
+import threading
+ui_fire_lock = threading.Lock()
+
 def fire_ui_handlers(event, d):
     if not _uiready:
         # No UI handlers registered yet, queue up the messages
         ui_queue.append(event)
         return
 
+    ui_fire_lock.acquire()
+
     errors = []
     for h in _ui_handlers:
         #print &quot;Sending event %s&quot; % event
@@ -169,6 +174,9 @@ def fire_ui_handlers(event, d):
     for h in errors:
         del _ui_handlers[h]
 
+
+    ui_fire_lock.release()
+
 def fire(event, d):
     &quot;&quot;&quot;Fire off an Event&quot;&quot;&quot;
 
@@ -176,7 +184,6 @@ def fire(event, d):
     # desired so they get the task based datastore.
     # UI handlers need to be fired in the server context so we defer this. They
     # don&apos;t have a datastore so the datastore context isn&apos;t a problem.
-
     fire_class_handlers(event, d)
     if worker_fire:
         worker_fire(event, d)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66874</commentid>
    <comment_count>5</comment_count>
    <who name="Aníbal Limón">anibal.limon</who>
    <bug_when>2016-10-04 16:47:16 +0000</bug_when>
    <thetext>Patches sent at bitbake devel an oe-core,

http://lists.openembedded.org/pipermail/bitbake-devel/2016-October/008129.html
http://lists.openembedded.org/pipermail/openembedded-core/2016-October/127274.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66942</commentid>
    <comment_count>6</comment_count>
    <who name="Aníbal Limón">anibal.limon</who>
    <bug_when>2016-10-05 15:08:41 +0000</bug_when>
    <thetext>At bitbake,

http://git.openembedded.org/bitbake/commit/?id=a583dc0b296415ec904c081c4de96ceef46732a8

At poky,

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=f2053844958325496a9387874a8f3182400b71ca
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=79012f943d3b3af1f439022f05a1287a383cd3f8</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>