Bug 106732 - [JSC] IndexedDB: Deactivate new transactions when exiting worker script context
Summary: [JSC] IndexedDB: Deactivate new transactions when exiting worker script context
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 107194 111171
  Show dependency treegraph
 
Reported: 2013-01-12 17:28 PST by Michael Pruett
Modified: 2022-07-11 15:00 PDT (History)
11 users (show)

See Also:


Attachments
Patch (1.98 KB, patch)
2013-01-13 13:51 PST, Michael Pruett
no flags Details | Formatted Diff | Diff
Patch (21.44 KB, patch)
2013-01-15 11:53 PST, Michael Pruett
buildbot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Pruett 2013-01-12 17:28:21 PST
When exiting the main thread script state, IDBPendingTransactionMonitor::deactivateNewTransactions() is called (JSMainThreadExecState::didLeaveScriptContext() in Source/WebCore/bindings/js/JSMainThreadExecState.cpp). The same call should be made when exiting a worker script context as well.

Currently these two tests fail on JSC because of this problem:

storage/indexeddb/pending-activity-workers.html
storage/indexeddb/transaction-complete-workers.html
Comment 1 Michael Pruett 2013-01-13 13:51:12 PST
Created attachment 182490 [details]
Patch
Comment 2 Michael Pruett 2013-01-15 11:53:34 PST
Created attachment 182820 [details]
Patch
Comment 3 Build Bot 2013-01-15 12:44:17 PST
Comment on attachment 182820 [details]
Patch

Attachment 182820 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/15904078
Comment 4 Geoffrey Garen 2013-01-15 14:25:43 PST
> "the flag be set to false when control returns to the event loop"

I think you've missed a lot of cases. JSLockHolder is the object we use to indicate entry to the JS engine, and there are 218 instances of it in the WebKit project.

Is there a simpler bottleneck for catching returns to the runloop? Hooking into shared timer might get you most of the way there.
Comment 5 Alec Flett 2013-03-07 14:45:09 PST
I have a fix for the inspector, for V8 - it uses V8RecursionScope. Not sure if/when the JSC stuff is going in though.
Comment 6 Adam Klein 2013-03-07 17:32:07 PST
(In reply to comment #4)
> > "the flag be set to false when control returns to the event loop"
> 
> I think you've missed a lot of cases. JSLockHolder is the object we use to indicate entry to the JS engine, and there are 218 instances of it in the WebKit project.
> 
> Is there a simpler bottleneck for catching returns to the runloop? Hooking into shared timer might get you most of the way there.

FWIW, if you do find a way to hook a return to the run loop, that would also provide a fix for bug 78290.
Comment 7 Brent Fulgham 2022-07-11 15:00:35 PDT
These tests appear to work properly in modern WebKit (as of 2022), so this seems to have progressed through other IndexedDB work.