Bug 64552 - [V8] Pending indexed db transactions cancelled to aggressively at script exit
Summary: [V8] Pending indexed db transactions cancelled to aggressively at script exit
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nate Chapin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-14 12:55 PDT by Nate Chapin
Modified: 2011-07-19 15:14 PDT (History)
4 users (show)

See Also:


Attachments
patch (2.07 KB, patch)
2011-07-14 13:05 PDT, Nate Chapin
no flags Details | Formatted Diff | Diff
fix style issue + test (6.24 KB, patch)
2011-07-15 13:24 PDT, Nate Chapin
no flags Details | Formatted Diff | Diff
Patch for landing (6.29 KB, patch)
2011-07-19 13:35 PDT, Nate Chapin
no flags Details | Formatted Diff | Diff
Patch for landing (6.32 KB, patch)
2011-07-19 15:02 PDT, Nate Chapin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Chapin 2011-07-14 12:55:27 PDT
Current, v8 cancels pending indexed db transactions as soon as it exits a context, even if we're in a recursive v8 call. We should wait until we've got v8 entirely off the stack before cancelling the pending transactions.
Comment 1 Nate Chapin 2011-07-14 13:05:39 PDT
Created attachment 100851 [details]
patch

I haven't figured out a good way to isolate the test case as of yet, so no layout test included. Assistance welcome :)
Comment 2 WebKit Review Bot 2011-07-14 13:07:16 PDT
Attachment 100851 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/bindings/v8/V8Proxy.cpp:617:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Adam Barth 2011-07-14 23:00:09 PDT
You should be able to trigger this case by using dispatchEvent to call an event handler synchronously.  That will enter/leave a nested V8 context, which you can observe to cancel your IDB transaction.
Comment 4 Adam Barth 2011-07-14 23:00:35 PDT
(The patch looks correct, BTW, but it might be worth trying a test along those lines.)
Comment 5 Adam Barth 2011-07-14 23:08:11 PDT
Comment on attachment 100851 [details]
patch

Clearing the review flag while you investigate a test.
Comment 6 Nate Chapin 2011-07-15 13:24:39 PDT
Created attachment 101036 [details]
fix style issue + test

Thanks for the test suggestion....I was having a brain cramp on how to guarantee we had a recursive JS call.
Comment 7 David Grogan 2011-07-18 13:35:56 PDT
Comment on attachment 101036 [details]
fix style issue + test

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

Thanks a lot for picking this up.

> LayoutTests/storage/indexeddb/transaction-abort-with-js-recursion.html:26
> +    request = evalAndLog("webkitIndexedDB.open('test')");

Could you change 'test' to 'transaction-abort-with-js-recursion'?  Running the layout tests in parallel can fail if multiple tests are mucking with the same db, so we've been using the name of the test.
Comment 8 Adam Barth 2011-07-19 11:36:53 PDT
Comment on attachment 101036 [details]
fix style issue + test

Yay.  Thanks!
Comment 9 Nate Chapin 2011-07-19 13:35:37 PDT
Created attachment 101373 [details]
Patch for landing
Comment 10 WebKit Review Bot 2011-07-19 14:23:16 PDT
Comment on attachment 101373 [details]
Patch for landing

Rejecting attachment 101373 [details] from commit-queue.

Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=ec2-cq-02', '--port..." exit_code: 2

Last 500 characters of output:
operties.html = TEXT
  fast/table/align-right-within-left-aligned-div.html = TEXT
  storage/indexeddb/transaction-abort-with-js-recursion.html = TEXT

Regressions: Unexpected image mismatch : (5)
  fast/text/atsui-multiple-renderers.html = IMAGE
  fast/text/international/danda-space.html = IMAGE
  fast/text/international/thai-baht-space.html = IMAGE
  fast/text/international/thai-line-breaks.html = IMAGE
  platform/chromium-linux/fast/text/international/complex-joining-using-gpos.html = IMAGE



Full output: http://queues.webkit.org/results/9191008
Comment 11 Nate Chapin 2011-07-19 15:02:13 PDT
Created attachment 101394 [details]
Patch for landing
Comment 12 WebKit Review Bot 2011-07-19 15:14:11 PDT
Comment on attachment 101394 [details]
Patch for landing

Clearing flags on attachment: 101394

Committed r91309: <http://trac.webkit.org/changeset/91309>
Comment 13 WebKit Review Bot 2011-07-19 15:14:16 PDT
All reviewed patches have been landed.  Closing bug.