<?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>98314</bug_id>
          
          <creation_ts>2012-10-03 15:54:40 -0700</creation_ts>
          <short_desc>IndexedDB: Possible cause of transactions committing early</short_desc>
          <delta_ts>2012-11-15 17:02:46 -0800</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>523.x (Safari 3)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>102283</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joshua Bell">jsbell</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>alecflett</cc>
    
    <cc>dgrogan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>734124</commentid>
    <comment_count>0</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-10-03 15:54:40 -0700</bug_when>
    <thetext>This was noticed in code inspection - I don&apos;t have a repro.

In IDBTransactionBackendImpl::taskEventTimerFired:

    if (!m_pendingEvents &amp;&amp; isTaskQueueEmpty()) {
	// The last task event has completed and the task                                                               
        // queue is empty. Commit the transaction.                                                                      
        commit();
        return;
    }

This does not account for m_pendingPreemptiveEvents which may nonzero 0 even if there are no events in the queue. For example, after a createIndex() call it might bump that count but yet have placed any tasks in the queues or bumped m_pendingEvents. If the timer fires, the commit() could occur before the indexing occurs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>768696</commentid>
    <comment_count>1</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-11-15 17:02:46 -0800</bug_when>
    <thetext>Landed this fix as a possible patch for webkit.org/b/102283 so marking as a dupe

*** This bug has been marked as a duplicate of bug 102283 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>