RESOLVED FIXED 79308
[V8] IndexedDB: IDBTransaction objects leak in Workers
https://bugs.webkit.org/show_bug.cgi?id=79308
Summary [V8] IndexedDB: IDBTransaction objects leak in Workers
Joshua Bell
Reported 2012-02-22 17:10:42 PST
[V8] IndexedDB: IDBTransaction objects leak in Workers
Attachments
Patch (4.22 KB, patch)
2012-02-22 17:11 PST, Joshua Bell
no flags
Patch (17.69 KB, patch)
2012-02-23 13:46 PST, Joshua Bell
no flags
Patch (17.03 KB, patch)
2012-02-23 14:37 PST, Joshua Bell
no flags
Joshua Bell
Comment 1 2012-02-22 17:11:00 PST
Joshua Bell
Comment 2 2012-02-22 17:13:34 PST
http://crbug.com/115341 has repro steps I have no idea if the patch is complete or sensible, but it appears to address the issue.
Dmitry Lomov
Comment 3 2012-02-22 17:35:33 PST
Comment on attachment 128341 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=128341&action=review The patch looks good, but will be nice to have tests > Source/WebCore/ChangeLog:8 > + No new tests. (OOPS!) Can we have a layout test for this?
Joshua Bell
Comment 4 2012-02-23 13:46:00 PST
Joshua Bell
Comment 5 2012-02-23 13:50:07 PST
(In reply to comment #3) > Can we have a layout test for this? Of course! I identified a few more points where Workers call into script (Events, Errors) so those are handled and there are tests. (Having to trap the Worker's error event in the page is unfortunate.)
Joshua Bell
Comment 6 2012-02-23 13:51:58 PST
dslomov, are there other reviewers I should have take a look at this?
Dmitry Lomov
Comment 7 2012-02-23 14:08:05 PST
(In reply to comment #6) > dslomov, are there other reviewers I should have take a look at this? (I am not a reviewer) levin@ and dimich@ would be other people, but I know they are both on vacation. I'll add abarth@ too. maybe he can review, suggest someone else or trust my judgement.
Adam Barth
Comment 8 2012-02-23 14:19:07 PST
This seems related to https://bugs.webkit.org/show_bug.cgi?id=72063 +rafaelw: thoughts on this patch?
Adam Barth
Comment 9 2012-02-23 14:19:44 PST
This generally seems reasonable to me, but we should check with rafaelw.
Dmitry Lomov
Comment 10 2012-02-23 14:22:47 PST
Comment on attachment 128548 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=128548&action=review LGTM with nit and other ports' expectations > LayoutTests/fast/js/resources/js-test-pre.js:469 > + }; nit: Is this required for this fix? We try to avoid unnecessary style changes bundled with patches. Ditto other places. > LayoutTests/storage/indexeddb/transaction-abort-workers-expected.txt:1 > +[Worker] Test IndexedDB workers, recursion, and transaction termination. Do JSC ports work fine on this test?
Joshua Bell
Comment 11 2012-02-23 14:27:28 PST
(In reply to comment #10) > (From update of attachment 128548 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=128548&action=review > > LGTM with nit and other ports' expectations > > > LayoutTests/fast/js/resources/js-test-pre.js:469 > > + }; > > nit: Is this required for this fix? We try to avoid unnecessary style changes bundled with patches. Ditto other places. Not required; I'll pull it out. > > > LayoutTests/storage/indexeddb/transaction-abort-workers-expected.txt:1 > > +[Worker] Test IndexedDB workers, recursion, and transaction termination. > > Do JSC ports work fine on this test? Only the Chromium/V8 currently enables IndexedDB; see https://bugs.webkit.org/show_bug.cgi?id=45110
Dmitry Lomov
Comment 12 2012-02-23 14:29:51 PST
(In reply to comment #11) > (In reply to comment #10) > > (From update of attachment 128548 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=128548&action=review > > > > LGTM with nit and other ports' expectations > > > > > LayoutTests/fast/js/resources/js-test-pre.js:469 > > > + }; > > > > nit: Is this required for this fix? We try to avoid unnecessary style changes bundled with patches. Ditto other places. > > Not required; I'll pull it out. > > > > > > LayoutTests/storage/indexeddb/transaction-abort-workers-expected.txt:1 > > > +[Worker] Test IndexedDB workers, recursion, and transaction termination. > > > > Do JSC ports work fine on this test? > > Only the Chromium/V8 currently enables IndexedDB; see https://bugs.webkit.org/show_bug.cgi?id=45110 Right so this test will fail on those ports wouldn't it? You should add it to the appropriate platform/*/Skipped
Joshua Bell
Comment 13 2012-02-23 14:32:17 PST
(In reply to comment #12)> > Right so this test will fail on those ports wouldn't it? You should add it to the appropriate platform/*/Skipped All of storage/indexeddb is skipped on all of the non-Chromium platforms.
Dmitry Lomov
Comment 14 2012-02-23 14:33:59 PST
(In reply to comment #13) > (In reply to comment #12)> > > Right so this test will fail on those ports wouldn't it? You should add it to the appropriate platform/*/Skipped > > All of storage/indexeddb is skipped on all of the non-Chromium platforms. Got it - thanks!
Joshua Bell
Comment 15 2012-02-23 14:37:28 PST
David Grogan
Comment 16 2012-02-23 20:03:19 PST
Comment on attachment 128558 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=128558&action=review LGTM, FWIW > LayoutTests/fast/js/resources/js-test-pre.js:463 > + return worker; Thanks for adding this, I had to add it locally for something else. > LayoutTests/storage/indexeddb/resources/transaction-abort-workers.js:37 > + evalAndLog("store = transaction.objectStore('store')"); Before this patch, none of these event handlers would be called? > LayoutTests/storage/indexeddb/resources/transaction-abort-workers.js:50 > +function recursionTest() This still worked before this patch, right? > LayoutTests/storage/indexeddb/resources/transaction-abort-workers.js:86 > +function timeoutTest() This tests the change to V8WorkerContextEventListener.cpp ?
Joshua Bell
Comment 17 2012-02-23 21:21:33 PST
(In reply to comment #16) > (From update of attachment 128558 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=128558&action=review > > LGTM, FWIW > > > LayoutTests/fast/js/resources/js-test-pre.js:463 > > + return worker; > > Thanks for adding this, I had to add it locally for something else. > > > LayoutTests/storage/indexeddb/resources/transaction-abort-workers.js:37 > > + evalAndLog("store = transaction.objectStore('store')"); > > Before this patch, none of these event handlers would be called? Yes. Because the transaction didn't start, it would remain in the queue since an abort was never fired. > > LayoutTests/storage/indexeddb/resources/transaction-abort-workers.js:50 > > +function recursionTest() > > This still worked before this patch, right? Yes; this test is to verify that the transaction abort logic isn't kicking in too early with the change > > > LayoutTests/storage/indexeddb/resources/transaction-abort-workers.js:86 > > +function timeoutTest() > > This tests the change to V8WorkerContextEventListener.cpp ? The timeout test tests the change to ScheduledAction.cpp (which deals with setTimeout, setInterval and friends). The V8WorkerContextEventListener.cpp change is actually tested by the createTransaction test, since that runs in response to the setVersion's transaction's "complete" event. The V8WorkerContextErrorHandler.cpp change is tested by the errorTest. The WorkerContextExecutionProxy.cpp change is not directly tested, since it would require a transaction to be created in the worker's "root" execution context and not in any event/error/scheduled callbacks, which I don't think is possible in IDB (since you get the initial DB handle via a callback). Ideas welcome, though.
Adam Klein
Comment 18 2012-02-24 15:07:59 PST
Looks good to me from the V8RecursionScope angle.
WebKit Review Bot
Comment 19 2012-02-24 16:27:04 PST
Comment on attachment 128558 [details] Patch Clearing flags on attachment: 128558 Committed r108867: <http://trac.webkit.org/changeset/108867>
WebKit Review Bot
Comment 20 2012-02-24 16:27:10 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.