Bug 88052 - IndexedDB: Transactions without any request scheduled should abort itself.
Summary: IndexedDB: Transactions without any request scheduled should abort itself.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Charles Wei
URL:
Keywords:
Depends on:
Blocks: 45110
  Show dependency treegraph
 
Reported: 2012-06-01 00:26 PDT by Charles Wei
Modified: 2014-04-24 16:45 PDT (History)
15 users (show)

See Also:


Attachments
Patch (3.85 KB, patch)
2012-06-01 00:39 PDT, Charles Wei
no flags Details | Formatted Diff | Diff
Patch (3.86 KB, patch)
2012-06-01 02:04 PDT, Charles Wei
no flags Details | Formatted Diff | Diff
Patch (2.98 KB, patch)
2012-06-07 04:29 PDT, Charles Wei
no flags Details | Formatted Diff | Diff
Patch (2.99 KB, patch)
2012-06-08 02:04 PDT, Charles Wei
no flags Details | Formatted Diff | Diff
Patch (3.00 KB, patch)
2012-06-08 02:31 PDT, Charles Wei
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Wei 2012-06-01 00:26:29 PDT
IndexedDB transactions without any request should abort itself.  We need to enforce this for JSC binding.
Comment 1 Charles Wei 2012-06-01 00:39:01 PDT
Created attachment 145229 [details]
Patch
Comment 2 Gustavo Noronha (kov) 2012-06-01 00:47:08 PDT
Comment on attachment 145229 [details]
Patch

Attachment 145229 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/12869424
Comment 3 Build Bot 2012-06-01 00:47:42 PDT
Comment on attachment 145229 [details]
Patch

Attachment 145229 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/12872320
Comment 4 Early Warning System Bot 2012-06-01 01:18:29 PDT
Comment on attachment 145229 [details]
Patch

Attachment 145229 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/12866454
Comment 5 Early Warning System Bot 2012-06-01 01:30:45 PDT
Comment on attachment 145229 [details]
Patch

Attachment 145229 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/12870393
Comment 6 Gyuyoung Kim 2012-06-01 01:47:24 PDT
Comment on attachment 145229 [details]
Patch

Attachment 145229 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/12871410
Comment 7 Charles Wei 2012-06-01 02:04:18 PDT
Created attachment 145244 [details]
Patch
Comment 8 Joshua Bell 2012-06-04 11:16:59 PDT
Comment on attachment 145244 [details]
Patch

From an IDB perspective, these changes look correct but I can't speak to whether they are hitting all the correct cases in JSC.

The V8 equivalent of this resides in V8RecursionScope which handles both IDB and mutation observers which need processing when returning from script. That approach would be cleaner than sprinkling multiple IDB-specific ENABLED checks/calls throughout the JSC code. The V8RecursionScope class also handles (1) recursion (duh) which I believe is tested in the storage/indexeddb/transaction-abort-with-js-recursion.html layout test (so may not be necessary with the JSC changes here) and (2) RAII-style calling of the post-script function in the scope destructor, which would simplify the code in evaluateInWorld.
Comment 9 Charles Wei 2012-06-07 04:29:54 PDT
Created attachment 146252 [details]
Patch
Comment 10 Kentaro Hara 2012-06-08 01:14:16 PDT
Comment on attachment 146252 [details]
Patch

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

> Source/WebCore/ChangeLog:11
> +        No test because JSC binding for IndexedDB not working yet.

I've seen a couple of patches for trying to make IndexedDB work in JSC without testing. Actually I do not want to land a lot of patches without testing just because it is not yet enabled. How much work would be needed by the time we can enable IndexedDB in JSC and make it testable?

> Source/WebCore/bindings/js/JSMainThreadExecState.cpp:31
> +#include <IDBPendingTransactionMonitor.h>

You should use #include "IDBPendingTransactionMonitor.h".
Comment 11 Kentaro Hara 2012-06-08 01:16:02 PDT
cc-ing JSC folks.
Comment 12 Charles Wei 2012-06-08 01:35:40 PDT
Comment on attachment 146252 [details]
Patch

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

>> Source/WebCore/ChangeLog:11
>> +        No test because JSC binding for IndexedDB not working yet.
> 
> I've seen a couple of patches for trying to make IndexedDB work in JSC without testing. Actually I do not want to land a lot of patches without testing just because it is not yet enabled. How much work would be needed by the time we can enable IndexedDB in JSC and make it testable?

Kentaro:  Doesn't have a new test case doesn't mean it's not tested.  Actually the JSC binding for IndexedDB is working in my local environment and working. I've tested them using the existing indexed test cases in LayoutTests/storage/indexeddb.  I am trying to land all the indexed patches gradually, with each patch deals with one specific issue.  All the problems have been identified and filed as bugs,  please look at all blockers of 45110. We need all the blocking issues fixed to make IndexedDB full functional for JSC.

>> Source/WebCore/bindings/js/JSMainThreadExecState.cpp:31
>> +#include <IDBPendingTransactionMonitor.h>
> 
> You should use #include "IDBPendingTransactionMonitor.h".

Sure.
Comment 13 Kentaro Hara 2012-06-08 01:46:04 PDT
(In reply to comment #12)
> Kentaro:  Doesn't have a new test case doesn't mean it's not tested.  Actually the JSC binding for IndexedDB is working in my local environment and working. I've tested them using the existing indexed test cases in LayoutTests/storage/indexeddb.  I am trying to land all the indexed patches gradually, with each patch deals with one specific issue.  All the problems have been identified and filed as bugs,  please look at all blockers of 45110. We need all the blocking issues fixed to make IndexedDB full functional for JSC.

Sounds nice. Then you might want to describe that in ChangeLog, i.e. what tests you've tested manually in your local environment.
Comment 14 Charles Wei 2012-06-08 02:04:28 PDT
Created attachment 146511 [details]
Patch
Comment 15 Kentaro Hara 2012-06-08 02:22:55 PDT
Comment on attachment 146511 [details]
Patch

Looks OK to me.

JSC folks: would you take a look?
Comment 16 Charles Wei 2012-06-08 02:31:13 PDT
Created attachment 146521 [details]
Patch
Comment 17 Geoffrey Garen 2012-06-08 09:16:37 PDT
LGTM.
Comment 18 Kentaro Hara 2012-06-08 09:18:54 PDT
Comment on attachment 146521 [details]
Patch

Let me mark r+ based on LGTM from ggaren and jsbell.
Comment 19 WebKit Review Bot 2012-06-08 16:41:55 PDT
Comment on attachment 146521 [details]
Patch

Clearing flags on attachment: 146521

Committed r119876: <http://trac.webkit.org/changeset/119876>
Comment 20 WebKit Review Bot 2012-06-08 16:42:11 PDT
All reviewed patches have been landed.  Closing bug.
Comment 21 Joshua Bell 2012-06-21 11:02:16 PDT
FYI, while WebKit's IDB implementation works this way (empty transactions abort) it's actually not in the spec and is not how Firefox behaves (empty transactions complete).

I'll be fixing this as part of https://bugs.webkit.org/show_bug.cgi?id=89379 

Basically, the same logic is needed though - at end of an excursion into script, IDB needs a callback so it can poke transaction states. It's just the response to that poke that needs to change.
Comment 22 Darin Adler 2014-04-24 16:45:42 PDT
Moving all JavaScriptGlue bugs to JavaScriptCore. The JavaScriptGlue framework itself is long gone. And most of the more recent bugs put in this component were put there by people who thought this was for some other aspect of “JavaScript glue” and have nothing to do with the actual original reason for the existence of this component, which was an OS-X-only framework named JavaScriptGlue.