Bug 102283 - IndexedDB: Indexing tests are flaky-crashing
Summary: IndexedDB: Indexing tests are flaky-crashing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joshua Bell
URL:
Keywords:
: 98314 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-11-14 14:01 PST by Joshua Bell
Modified: 2012-11-15 17:02 PST (History)
6 users (show)

See Also:


Attachments
Patch (1.67 KB, patch)
2012-11-14 14:11 PST, Joshua Bell
no flags Details | Formatted Diff | Diff
Patch (4.44 KB, patch)
2012-11-15 12:18 PST, Joshua Bell
no flags Details | Formatted Diff | Diff
Patch for landing (5.49 KB, patch)
2012-11-15 13:21 PST, Joshua Bell
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Bell 2012-11-14 14:01:39 PST
IndexedDB: Indexing tests are flaky-crashing
Comment 1 Joshua Bell 2012-11-14 14:10:34 PST
A couple of indexing related tests have started crashing:

http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=storage%2Findexeddb%2Fmozilla%2Fcursor-update-updates-indexes.html%2Cstorage%2Findexeddb%2Findex-duplicate-keypaths.html

Although some of the crashes predate it, http://wkrev.com/134529 is a likely candidate for the "spike" (hard to tell, there are so few of them).

While inspecting the code, I noticed this test 

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

This doesn't look at m_pendingPreemptiveEvents, so it could commit() early in the case of an indexing operation (the source of preemptive events), which could lead to calls being made into the IDBTransactionBackendImpl after it commit and was destroyed. Prior to http://wkrev.com/134529 the events would happen one at a time so the likelihood of this occurring would be lower.
Comment 2 Joshua Bell 2012-11-14 14:11:56 PST
Created attachment 174256 [details]
Patch
Comment 3 Joshua Bell 2012-11-14 14:12:44 PST
alecflett@ - please take a look?
Comment 4 Joshua Bell 2012-11-14 14:14:47 PST
+dglazkov@, +haraken@ as an FYI to the gardeners. This probably hasn't shown up on your radar yet, but if it does and this patch doesn't fix it please roll out http://wkrev.com/134529
Comment 5 Alec Flett 2012-11-14 14:38:09 PST
lgtm
Comment 6 Joshua Bell 2012-11-14 15:23:26 PST
tony@ - r?
Comment 7 Tony Chang 2012-11-14 15:26:39 PST
Comment on attachment 174256 [details]
Patch

Ok, let's try it.
Comment 8 WebKit Review Bot 2012-11-14 15:52:40 PST
Comment on attachment 174256 [details]
Patch

Clearing flags on attachment: 174256

Committed r134685: <http://trac.webkit.org/changeset/134685>
Comment 9 WebKit Review Bot 2012-11-14 15:52:43 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Joshua Bell 2012-11-15 11:58:25 PST
Reopening - flakiness has not gone away.

The fix that was landed as http://wkrev.com/134685 is still believed to be a good addition so it should not be rolled out. It may explain a very low frequency of "early commits" that we have had reports of but have been unable to repro.
Comment 11 Joshua Bell 2012-11-15 12:18:09 PST
Created attachment 174498 [details]
Patch
Comment 12 Joshua Bell 2012-11-15 12:18:25 PST
tony@ - another r?
Comment 13 Tony Chang 2012-11-15 13:08:24 PST
Comment on attachment 174498 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=174498&action=review

> Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp:251
> +    RefPtr<IDBTransactionBackendImpl> self(this);

Nit: It's common in WebKit code to name this type of self reference protect or protector (you can grep for other examples of this).
Comment 14 Joshua Bell 2012-11-15 13:21:38 PST
Created attachment 174506 [details]
Patch for landing
Comment 15 WebKit Review Bot 2012-11-15 15:18:06 PST
Comment on attachment 174506 [details]
Patch for landing

Clearing flags on attachment: 174506

Committed r134838: <http://trac.webkit.org/changeset/134838>
Comment 16 WebKit Review Bot 2012-11-15 15:18:10 PST
All reviewed patches have been landed.  Closing bug.
Comment 17 Joshua Bell 2012-11-15 17:02:46 PST
*** Bug 98314 has been marked as a duplicate of this bug. ***