<?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>7316</bug_id>
          
          <creation_ts>2015-02-13 11:03:19 +0000</creation_ts>
          <short_desc>Builds fail to start after a configuration change when Toaster is running in analysis (i.e. interactive) mode</short_desc>
          <delta_ts>2015-03-13 15:42:08 +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>unspecified</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>High</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>1.8 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Belen Barros Pena">belen.barros.pena</reporter>
          <assigned_to name="Alexandru Damian">alexandru.damian</assigned_to>
          <cc>alexandru.damian</cc>
    
    <cc>belen.barros.pena</cc>
    
    <cc>bluelightning</cc>
    
    <cc>cristiana.voicu</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>richard.purdie</cc>
          
          <qa_contact name="Mihail Stanciu">stanciux.mihail</qa_contact>
          <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>48799</commentid>
    <comment_count>0</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-02-13 11:03:19 +0000</bug_when>
    <thetext>Found in master:231d4a9d3d89af4b1b5f6ea439c630e4cac82079 

Steps to reproduce:

1. Source the environment script
2. Start Toaster in analysis mode (source toaster start)
3. Build something (e.g. busybox)
4. When the build completes, edit the MACHINE variable in the local.conf file
5. Start a busybox build

The build fails to start with this error:

ERROR: Command execution failed: Traceback (most recent call last):
File &quot;/home/yocto/master/bitbake/lib/bb/command.py&quot;, line 99, in
runAsyncCommand
self.cooker.updateCache()
File &quot;/home/yocto/master/bitbake/lib/bb/cooker.py&quot;, line 1438, in updateCache
n.process_events()
File &quot;/home/yocto/master/bitbake/lib/pyinotify.py&quot;, line 1321, in
process_events
self._default_proc_fun(revent)
File &quot;/home/yocto/master/bitbake/lib/bb/cooker.py&quot;, line 174, in
config_notifications
bb.parse.update_cache(event.path)
AttributeError: &apos;Event&apos; object has no attribute &apos;path&apos;

This only happens when Toaster is running.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48806</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2015-02-13 12:13:30 +0000</bug_when>
    <thetext>I reproduced this and traced it. The issue is that there are a ton of writes to the toaster sqlite database and this overflows the inotify queue. Changing cooker.py to do:
 
     def config_notifications(self, event):
+        bb.warn(str(event))
         bb.parse.update_cache(event.path)
         self.baseconfig_valid = False

results in a ton of output ending with:

WARNING: &lt;Event dir=False mask=0x2 maskname=IN_MODIFY name=toaster.sqlite path=/media/build1/poky/build pathname=/media/build1/poky/build/toaster.sqlite wd=21 &gt;
WARNING: &lt;Event dir=False mask=0x8 maskname=IN_CLOSE_WRITE name=toaster.sqlite-journal path=/media/build1/poky/build pathname=/media/build1/poky/build/toaster.sqlite-journal wd=21 &gt;
WARNING: &lt;Event dir=False mask=0x200 maskname=IN_DELETE name=toaster.sqlite-journal path=/media/build1/poky/build pathname=/media/build1/poky/build/toaster.sqlite-journal wd=21 &gt;
WARNING: &lt;Event dir=False mask=0x100 maskname=IN_CREATE name=toaster.sqlite-journal path=/media/build1/poky/build pathname=/media/build1/poky/build/toaster.sqlite-journal wd=21 &gt;
WARNING: &lt;Event dir=False mask=0x2 maskname=IN_MODIFY name=toaster.sqlite-journal path=/media/build1/poky/build pathname=/media/build1/poky/build/toaster.sqlite-journal wd=21 &gt;
WARNING: &lt;Event dir=False mask=0x2 maskname=IN_MODIFY name=toaster.sqlite path=/media/build1/poky/build pathname=/media/build1/poky/build/toaster.sqlite wd=21 &gt;
WARNING: &lt;Event dir=False mask=0x8 maskname=IN_CLOSE_WRITE name=toaster.sqlite-journal path=/media/build1/poky/build pathname=/media/build1/poky/build/toaster.sqlite-journal wd=21 &gt;
WARNING: &lt;Event mask=0x4000 maskname=IN_Q_OVERFLOW &gt;

so there are two takeaways:

a) We should not be watching build, we clearly are but shouldn&apos;t be.
b) We need to trap overflow events and warn the user instead of crashing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48807</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2015-02-13 12:17:02 +0000</bug_when>
    <thetext>Now I think about it, conf containing key conf files is in build so we need to watch this. We may need to write the toaster sqlite data somewhere else so we don&apos;t overload the inotify queue</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48997</commentid>
    <comment_count>3</comment_count>
    <who name="Alexandru Damian">alexandru.damian</who>
    <bug_when>2015-02-23 19:38:04 +0000</bug_when>
    <thetext>I reasoned that the overflowing is coming from the fact that the notifications are read very rarely, only during build setup, in updateCache.

But the notification data structures do not influence a currently-running build, so we can gather event data also during the build run, and use the recorded event data for the next build setup.


This patch adds a server idle function that performs inotify process_event during the actual server run.

Testing shows no impact in performance, and that the bug no longer occurs.



Pushed for review on 

poky-contrib: adamian/20150223_bug_7316</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49267</commentid>
    <comment_count>4</comment_count>
    <who name="Alexandru Damian">alexandru.damian</who>
    <bug_when>2015-03-06 15:47:55 +0000</bug_when>
    <thetext>Pushed new version for review on 

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=adamian/20150305_review&amp;id=c7b33b28cc014bd6537c77882abb8bb6a24f422c</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49367</commentid>
    <comment_count>5</comment_count>
    <who name="Alexandru Damian">alexandru.damian</who>
    <bug_when>2015-03-11 15:50:13 +0000</bug_when>
    <thetext>Merged to master.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49452</commentid>
    <comment_count>6</comment_count>
    <who name="Mihail Stanciu">stanciux.mihail</who>
    <bug_when>2015-03-13 15:42:08 +0000</bug_when>
    <thetext>Verified on master: 0aff27522d467ee5d02289594207ddef4add7081</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>