Summary: | IDB: Pending setVersion call in worker prevents document from opening the db, even after worker termination | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | David Grogan <dgrogan> | ||||||
Component: | New Bugs | Assignee: | David Grogan <dgrogan> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | alecflett, jsbell, ojan, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
David Grogan
2012-04-13 15:51:08 PDT
Created attachment 137168 [details]
Patch
Josh, Alec, could you take a look at these layout tests before I ask ojan or tony to review? The chrome bug these exercise is http://code.google.com/p/chromium/issues/detail?id=123418. Comment on attachment 137168 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=137168&action=review The logic of the test lgtm > LayoutTests/storage/indexeddb/pending-version-change-stuck-works-with-terminate.html:15 > + request.onsuccess = startTheWorker; I'd put this assignment in an "else" clause to the if block below, to improve readability. > LayoutTests/storage/indexeddb/pending-version-change-stuck-works-with-terminate.html:28 > + realFinishJSTest = finishJSTest; Rather than this IMHO fragile hooking into the finishJSTest mechanism, how about adding a new worker script that does a custom postMessage? (At some point we should add a better hook mechanism, e.g. startWorker(script, function myfilter(message) { if (handled) { return true; } }) Created attachment 137633 [details]
Patch
Comment on attachment 137168 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=137168&action=review >> LayoutTests/storage/indexeddb/pending-version-change-stuck-works-with-terminate.html:15 >> + request.onsuccess = startTheWorker; > > I'd put this assignment in an "else" clause to the if block below, to improve readability. Done. >> LayoutTests/storage/indexeddb/pending-version-change-stuck-works-with-terminate.html:28 >> + realFinishJSTest = finishJSTest; > > Rather than this IMHO fragile hooking into the finishJSTest mechanism, how about adding a new worker script that does a custom postMessage? > > (At some point we should add a better hook mechanism, e.g. startWorker(script, function myfilter(message) { if (handled) { return true; } }) Done. Agreed on the better hook mechanism. My plan was to add a method to the worker object that would let scripts assign handlers to codes. Comment on attachment 137633 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=137633&action=review > LayoutTests/storage/indexeddb/pending-version-change-stuck-works-with-terminate.html:35 > + originalOnMessage = worker.onmessage; This is still hacky but less hacky than the old patch. Just this bit of marginal unhackiness was enough to reveal that the tests did not pass in DRT either, so thanks for the suggestion. The unexpectedSuccessCallback from the worker was calling finishJSTest which reloaded the page with "?second", something I thought was being done by the finishJSTest call in the blocked handler. > LayoutTests/storage/indexeddb/pending-version-change-stuck-works-with-terminate.html:38 > + worker.terminate(); This line is the only difference between pending-version-change-stuck.html and pending-version-change-stuck-works-with-terminate.html. Comment on attachment 137633 [details]
Patch
lgtm
Ojan, could you review this? Comment on attachment 137633 [details] Patch Clearing flags on attachment: 137633 Committed r114540: <http://trac.webkit.org/changeset/114540> All reviewed patches have been landed. Closing bug. |