Bug 224356 - ServiceWorker should save module scripts
Summary: ServiceWorker should save module scripts
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
: 223135 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-04-08 19:36 PDT by Yusuke Suzuki
Modified: 2021-04-09 20:05 PDT (History)
3 users (show)

See Also:


Attachments
Patch (13.72 KB, patch)
2021-04-08 19:37 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (16.15 KB, patch)
2021-04-08 19:42 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (17.72 KB, patch)
2021-04-08 19:52 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (17.73 KB, patch)
2021-04-08 20:08 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (17.82 KB, patch)
2021-04-08 20:30 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (18.43 KB, patch)
2021-04-08 21:00 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (18.45 KB, patch)
2021-04-08 21:19 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (14.85 KB, patch)
2021-04-08 21:46 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (14.85 KB, patch)
2021-04-08 22:11 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (16.01 KB, patch)
2021-04-08 23:03 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (16.17 KB, patch)
2021-04-08 23:05 PDT, Yusuke Suzuki
youennf: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2021-04-08 19:36:37 PDT
ServiceWorker saves module scripts
Comment 1 Yusuke Suzuki 2021-04-08 19:37:57 PDT
Created attachment 425573 [details]
Patch
Comment 2 Yusuke Suzuki 2021-04-08 19:38:00 PDT
<rdar://problem/75634897>
Comment 3 Yusuke Suzuki 2021-04-08 19:42:19 PDT
Created attachment 425574 [details]
Patch
Comment 4 Yusuke Suzuki 2021-04-08 19:52:38 PDT
Created attachment 425576 [details]
Patch
Comment 5 Yusuke Suzuki 2021-04-08 20:08:48 PDT
Created attachment 425578 [details]
Patch
Comment 6 Yusuke Suzuki 2021-04-08 20:30:10 PDT
Created attachment 425579 [details]
Patch
Comment 7 Yusuke Suzuki 2021-04-08 21:00:53 PDT
Created attachment 425582 [details]
Patch
Comment 8 Yusuke Suzuki 2021-04-08 21:19:56 PDT
Created attachment 425583 [details]
Patch
Comment 9 Yusuke Suzuki 2021-04-08 21:46:47 PDT
Created attachment 425585 [details]
Patch
Comment 10 Yusuke Suzuki 2021-04-08 22:11:50 PDT
Created attachment 425586 [details]
Patch
Comment 11 Yusuke Suzuki 2021-04-08 22:31:06 PDT
We found that existing test mechanism "testRunner.terminateNetworkProcess" does not work well with guard-malloc configuration.

https://bugs.webkit.org/show_bug.cgi?id=224358
Comment 12 Yusuke Suzuki 2021-04-08 23:03:08 PDT
Created attachment 425588 [details]
Patch
Comment 13 Yusuke Suzuki 2021-04-08 23:05:59 PDT
Created attachment 425589 [details]
Patch
Comment 14 Yusuke Suzuki 2021-04-08 23:34:16 PDT
Comment on attachment 425589 [details]
Patch

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

> LayoutTests/http/wpt/service-workers/network-process-termination.html:21
> +<html>
> +<head>
> +<script src="resources/routines.js"></script>
> +</head>
> +<body>
> +<script>
> +if (window.testRunner) {
> +    testRunner.dumpAsText();
> +    testRunner.waitUntilDone();
> +}
> +async function doTest() {
> +    testRunner.terminateNetworkProcess();
> +    await waitFor(100);
> +    document.body.innerHTML = "PASS";
> +    if (window.testRunner)
> +        testRunner.notifyDone();
> +}
> +doTest();
> +</script>
> +</body>
> +</html>

I added this test to show that existing testRunner.terminateNetworkProcess() is not working well with mac-wk2-stress's guard-malloc runs. (possibly, killing the process does not work well for guard-malloc runs?).
But this is not an issue of this patch itself since it is just using the existing test mechanism (we have many tests using this).
This issue is filed separately in https://bugs.webkit.org/show_bug.cgi?id=224358
Comment 15 Yusuke Suzuki 2021-04-08 23:50:41 PDT
Comment on attachment 425589 [details]
Patch

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

>> LayoutTests/http/wpt/service-workers/network-process-termination.html:21
>> +</html>
> 
> I added this test to show that existing testRunner.terminateNetworkProcess() is not working well with mac-wk2-stress's guard-malloc runs. (possibly, killing the process does not work well for guard-malloc runs?).
> But this is not an issue of this patch itself since it is just using the existing test mechanism (we have many tests using this).
> This issue is filed separately in https://bugs.webkit.org/show_bug.cgi?id=224358

Note that this worked on local working environment with --guard-malloc. And since guard-malloc bot does not report failures about terminateNetworkProcess, this failure is specific to new EWS mac-wk2-stress's configuration.
Comment 16 youenn fablet 2021-04-09 01:35:09 PDT
Comment on attachment 425589 [details]
Patch

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

> Source/WebCore/bindings/js/ScriptModuleLoader.cpp:191
> +        // This can invoke callback immediately.

This comment is not very clear to me.

> Source/WebCore/bindings/js/ScriptModuleLoader.cpp:411
> +        m_requestURLToResponseURLMap.add(sourceURL.string(), responseURL);

WTFMove(responseURL)

> Source/WebCore/bindings/js/ScriptModuleLoader.cpp:459
> +        m_requestURLToResponseURLMap.add(sourceURL.string(), responseURL);

WTFMove

>>> LayoutTests/http/wpt/service-workers/network-process-termination.html:21
>>> +</html>
>> 
>> I added this test to show that existing testRunner.terminateNetworkProcess() is not working well with mac-wk2-stress's guard-malloc runs. (possibly, killing the process does not work well for guard-malloc runs?).
>> But this is not an issue of this patch itself since it is just using the existing test mechanism (we have many tests using this).
>> This issue is filed separately in https://bugs.webkit.org/show_bug.cgi?id=224358
> 
> Note that this worked on local working environment with --guard-malloc. And since guard-malloc bot does not report failures about terminateNetworkProcess, this failure is specific to new EWS mac-wk2-stress's configuration.

Maybe this test should be in its own patch?
Comment 17 Yusuke Suzuki 2021-04-09 01:37:12 PDT
Comment on attachment 425589 [details]
Patch

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

Thanks!

>> Source/WebCore/bindings/js/ScriptModuleLoader.cpp:191
>> +        // This can invoke callback immediately.
> 
> This comment is not very clear to me.

OK, removed.

>> Source/WebCore/bindings/js/ScriptModuleLoader.cpp:411
>> +        m_requestURLToResponseURLMap.add(sourceURL.string(), responseURL);
> 
> WTFMove(responseURL)

Looks good!

>> Source/WebCore/bindings/js/ScriptModuleLoader.cpp:459
>> +        m_requestURLToResponseURLMap.add(sourceURL.string(), responseURL);
> 
> WTFMove

We still use responseURL (L462).

>>>> LayoutTests/http/wpt/service-workers/network-process-termination.html:21
>>>> +</html>
>>> 
>>> I added this test to show that existing testRunner.terminateNetworkProcess() is not working well with mac-wk2-stress's guard-malloc runs. (possibly, killing the process does not work well for guard-malloc runs?).
>>> But this is not an issue of this patch itself since it is just using the existing test mechanism (we have many tests using this).
>>> This issue is filed separately in https://bugs.webkit.org/show_bug.cgi?id=224358
>> 
>> Note that this worked on local working environment with --guard-malloc. And since guard-malloc bot does not report failures about terminateNetworkProcess, this failure is specific to new EWS mac-wk2-stress's configuration.
> 
> Maybe this test should be in its own patch?

Sounds good. I'll upload this test in a filed bugzilla.
Comment 18 Yusuke Suzuki 2021-04-09 01:54:47 PDT
Committed r275751 (236329@main): <https://commits.webkit.org/236329@main>
Comment 19 Yusuke Suzuki 2021-04-09 20:05:37 PDT
*** Bug 223135 has been marked as a duplicate of this bug. ***