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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>158500</bug_id>
          
          <creation_ts>2016-06-07 17:05:59 -0700</creation_ts>
          <short_desc>REGRESSION (r201461): LayoutTest storage/indexeddb/database-close-private.html is a flaky failure</short_desc>
          <delta_ts>2016-07-12 14:10:43 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>154968</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryan Haddad">ryanhaddad</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>beidson</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1200246</commentid>
    <comment_count>0</comment_count>
    <who name="Ryan Haddad">ryanhaddad</who>
    <bug_when>2016-06-07 17:05:59 -0700</bug_when>
    <thetext>LayoutTest storage/indexeddb/database-close-private.html is a flaky failure

First failure seen a week ago around r201494

&lt;https://build.webkit.org/results/Apple%20Yosemite%20Debug%20WK1%20(Tests)/r201772%20(13568)/results.html&gt;
&lt;http://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&amp;tests=storage%2Findexeddb%2Fdatabase-close-private.html&gt;

--- /Volumes/Data/slave/yosemite-debug-tests-wk1/build/layout-test-results/storage/indexeddb/database-close-private-expected.txt
+++ /Volumes/Data/slave/yosemite-debug-tests-wk1/build/layout-test-results/storage/indexeddb/database-close-private-actual.txt
@@ -43,10 +43,8 @@
 transaction #2 request successful
 PASS event.target.result is &quot;value2&quot;
 
-All transactions completed - database deletes should now be unblocked.
-
 delete database unblocked
-PASS awaiting_transaction_count is 0
+FAIL awaiting_transaction_count should be 0. Was 1.
 PASS successfullyParsed is true
 
 TEST COMPLETE</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1200284</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2016-06-07 18:36:46 -0700</bug_when>
    <thetext>The first failure that I see was in r201466. Very likely caused by &lt;http://trac.webkit.org/projects/webkit/changeset/201461&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1200339</commentid>
    <comment_count>2</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-06-07 22:55:19 -0700</bug_when>
    <thetext>The test is probably bogus, will check it out in the A.M.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1200878</commentid>
    <comment_count>3</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-06-09 10:29:23 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; LayoutTest storage/indexeddb/database-close-private.html is a flaky failure
&gt; 
&gt; First failure seen a week ago around r201494
&gt; 
&gt; &lt;https://build.webkit.org/results/Apple%20Yosemite%20Debug%20WK1%20(Tests)/
&gt; r201772%20(13568)/results.html&gt;
&gt; &lt;http://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.
&gt; html#showAllRuns=true&amp;tests=storage%2Findexeddb%2Fdatabase-close-private.
&gt; html&gt;
&gt; 
&gt; ---
&gt; /Volumes/Data/slave/yosemite-debug-tests-wk1/build/layout-test-results/
&gt; storage/indexeddb/database-close-private-expected.txt
&gt; +++
&gt; /Volumes/Data/slave/yosemite-debug-tests-wk1/build/layout-test-results/
&gt; storage/indexeddb/database-close-private-actual.txt
&gt; @@ -43,10 +43,8 @@
&gt;  transaction #2 request successful
&gt;  PASS event.target.result is &quot;value2&quot;
&gt;  
&gt; -All transactions completed - database deletes should now be unblocked.
&gt; -
&gt;  delete database unblocked
&gt; -PASS awaiting_transaction_count is 0
&gt; +FAIL awaiting_transaction_count should be 0. Was 1.
&gt;  PASS successfullyParsed is true
&gt;  
&gt;  TEST COMPLETE

This is reallllllly weird.

The first transaction request *did* finish, as evidenced by the actual results.

So why did the count not get lowered?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1200884</commentid>
    <comment_count>4</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-06-09 10:36:56 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #0)
&gt; 
&gt; This is reallllllly weird.
&gt; 
&gt; The first transaction request *did* finish, as evidenced by the actual
&gt; results.
&gt; 
&gt; So why did the count not get lowered?

Oh, duh - The *requests* succeed, but we don&apos;t necessarily get the transaction complete event.

Okay.

Exploring more.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1201670</commentid>
    <comment_count>5</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-06-11 17:42:50 -0700</bug_when>
    <thetext>*** Bug 158644 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1205150</commentid>
    <comment_count>6</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-06-24 11:09:06 -0700</bug_when>
    <thetext>It&apos;s obvious how 201461 affected this, and I have a fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1205259</commentid>
    <comment_count>7</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-06-24 16:34:45 -0700</bug_when>
    <thetext>I created a modified test case that spins up 100 transactions instead of just 2.

It&apos;s always the same failure more - only 1 hasn&apos;t finished.

Then I epihanied: This is because the event for the second transaction completing is queued, and not fired, and *then* the delete operation is unblocked before the queued event fires.


It can never happen in the DatabaseProcess because of how the IPC races resolves themselves with the in process thread hopping races. - The delete being unblocked will never come in before the transaction complete event fires.

This is truly unique to the InProcessIDBServer, which basically spins the main thread run loop to simulate asynchroncity, but much more reliably triggers a case like this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1205265</commentid>
    <comment_count>8</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-06-24 16:43:07 -0700</bug_when>
    <thetext>I have changes to the test itself to make it much more likely to hit (though still not always)

And with that I can work on a fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1210151</commentid>
    <comment_count>9</comment_count>
    <who name="Ryan Haddad">ryanhaddad</who>
    <bug_when>2016-07-12 14:10:43 -0700</bug_when>
    <thetext>Marked test as flaky on Mac in &lt;http://trac.webkit.org/projects/webkit/changeset/203128&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>