<?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>8364</bug_id>
          
          <creation_ts>2015-09-21 10:24:46 +0000</creation_ts>
          <short_desc>Upgrade Toaster to use Django 1.8</short_desc>
          <delta_ts>2016-01-04 14:26:07 +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>2.1</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>normal</bug_severity>
          <target_milestone>2.1 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Wood">michael.g.wood</reporter>
          <assigned_to name="Ed Bartosh">eduard.bartosh</assigned_to>
          <cc>alexandru.costinx.roman</cc>
    
    <cc>belen.barros.pena</cc>
    
    <cc>brian.avery</cc>
    
    <cc>elliot.smith</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>stanciux.mihail</cc>
          
          <qa_contact name="Alexandru Roman">alexandru.costinx.roman</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>54363</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Wood">michael.g.wood</who>
    <bug_when>2015-09-21 10:24:46 +0000</bug_when>
    <thetext>Upgrade Django to 1.8 (This will be the LTS release once it&apos;s released in Dec) 2015, this will be skipping 1.7 and getting off the currently unsupported 1.6 release we&apos;re on now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54365</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Wood">michael.g.wood</who>
    <bug_when>2015-09-21 10:31:00 +0000</bug_when>
    <thetext>&apos;verify_prereq&apos; in bitbake/bin/toaster will also need fixing to reflect any version change. It would be good if this function checked the dependencies from the requirements.txt rather than hardcoding the values.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56570</commentid>
    <comment_count>2</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-11-18 09:41:39 +0000</bug_when>
    <thetext>I sent an RFC about this to the mailing list:https://lists.yoctoproject.org/pipermail/toaster/2015-November/003347.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56931</commentid>
    <comment_count>3</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-12-02 10:18:34 +0000</bug_when>
    <thetext>Assigned to Ed, as he&apos;s bisected changes to Django and identified the culprit commit which is causing the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57028</commentid>
    <comment_count>4</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2015-12-04 06:42:05 +0000</bug_when>
    <thetext>2 comments/questions:
1) Why did we choose Django 1.8.6? Should we do a toaster-requirements like Django &lt; 1.9?  that way we would get the most up to date 1.8 available

2) On ed&apos;s branch: ed/toaster/django_upgrade-8364  I had 170 errors like WARNING database is locked, model: &lt;class &apos;orm.models.Task&apos;&gt;, args: (), kwargs: {&apos;using&apos;: &apos;default&apos;, &apos;force_insert&apos;: True} from the final save attempt.  If I used the patch Ed had suggested we try applied to 1.8.6 + this branch I had 0 errors.

My diff against the standard 1.8.6:
(t-Django-1.8)bavery@whisper:~/src/intel/yocto-builds/TOASTER/myBugs/t-Django-1.8-ED_FIX$ diff ./lib/python2.7/site-packages/django/db/models/query.py ../t-Django-1.8/./lib/python2.7/site-packages/django/db/models/query.py
348,349c348
&lt;         with transaction.atomic(using=self.db):
&lt;             obj.save(force_insert=True, using=self.db)
---
&gt;         obj.save(force_insert=True, using=self.db)
439c438,439
&lt;             obj = self.create(**params)
---
&gt;             with transaction.atomic(using=self.db):
&gt;                 obj = self.create(**params)

-- So, Basically, from my testing we need more of the original fix in the create calls...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57029</commentid>
    <comment_count>5</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2015-12-04 07:29:49 +0000</bug_when>
    <thetext>the build that i used as a test case was core-sato-image-dev in my previous comment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57040</commentid>
    <comment_count>6</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-12-04 10:51:34 +0000</bug_when>
    <thetext>Brian, thank you for the review and testing! I&apos;ll try to fix what you pointed out.

As for the locking issue, I based my fix on the Elliot&apos;s feedback. He wasn&apos;t able to reproduce the issue with only this patch applied: https://gist.github.com/bartosh/8c188444e349a76cc1b9

Looks like monkey patching didn&apos;t work properly or I missed something.


Ellioth, can you confirm that the issue was gone in your setup with the above patch applied?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57041</commentid>
    <comment_count>7</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-12-04 10:54:13 +0000</bug_when>
    <thetext>Yes, the issue is gone with that patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57091</commentid>
    <comment_count>8</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2015-12-07 15:35:25 +0000</bug_when>
    <thetext>I tested poky-contrib/ed/toaster/django_upgrade-8364

In 3 different settings:
1) as is
2) with the monkeypatch reverted (revert 6b997fd0cb9d913ef734659386cc97985e428119)
3) additionally with the retry patch reverted (revert d27cdb20eebe14f532ec726e769cad399ccdedf5)

Results:
1) - worked flawlessly for me under 1.8.7 &amp; 1.8.6.
2) had over 100 &quot;database is locked&quot; errors in first 10%, no additional for most of the build and another 255 at the end (last 5%? ) of the build.  Additionally, because the retry is a .2 second loop, it would periodically make the ui unresponsive and I&apos;d get an error page briefly if I repeatedly hit &quot;all builds&quot; while it was doing this.
3) had ~ 100 &quot;database is locked&quot; errors.  From what I can tell, though I didn&apos;t verify this, when we have a database is locked error we lose data (namely the task we were storing).

Since #1 works, I&apos;d like to put it in early and see if the monkey&apos;s generate problems for anyone over the course of 2.1 testing. #2 hurts the UI and I&apos;m pretty sure #3 loses info...

Furthermore, it would be nice/good to submit the monkeypatch to Django to get the django people to comment on it. I seriously doubt they&apos;d accept it but their comments may very well be illuminating.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57158</commentid>
    <comment_count>9</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-12-10 12:25:46 +0000</bug_when>
    <thetext>The patchset is under review by upstream: http://lists.openembedded.org/pipermail/bitbake-devel/2015-December/006751.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57266</commentid>
    <comment_count>10</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2015-12-15 10:40:23 +0000</bug_when>
    <thetext>both patchset have been accepted upstream: http://cgit.openembedded.org/bitbake/commit/?id=49976eca4a6e37e7653814c569badcd3e0fb719a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57512</commentid>
    <comment_count>11</comment_count>
    <who name="Alexandru Roman">alexandru.costinx.roman</who>
    <bug_when>2016-01-04 14:26:07 +0000</bug_when>
    <thetext>Verified on master.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>