Bug 98314
| Summary: | IndexedDB: Possible cause of transactions committing early | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Joshua Bell <jsbell> |
| Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | alecflett, dgrogan |
| Priority: | P2 | ||
| Version: | 523.x (Safari 3) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Joshua Bell
This was noticed in code inspection - I don't have a repro.
In IDBTransactionBackendImpl::taskEventTimerFired:
if (!m_pendingEvents && 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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Joshua Bell
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 ***