Bug 209666 - Remove synchronous termination of service workers
Summary: Remove synchronous termination of service workers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Service Workers (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-03-27 11:06 PDT by youenn fablet
Modified: 2020-04-02 04:01 PDT (History)
4 users (show)

See Also:


Attachments
Patch (38.08 KB, patch)
2020-03-30 00:57 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (39.19 KB, patch)
2020-03-30 05:47 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (40.78 KB, patch)
2020-03-30 09:05 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (40.95 KB, patch)
2020-04-02 03:02 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2020-03-27 11:06:22 PDT
Remove synchronous termination of service workers
Comment 1 youenn fablet 2020-03-30 00:57:42 PDT
Created attachment 394890 [details]
Patch
Comment 2 youenn fablet 2020-03-30 05:47:47 PDT
Created attachment 394908 [details]
Patch
Comment 3 youenn fablet 2020-03-30 07:08:42 PDT
<rdar://problem/59318239>
Comment 4 Chris Dumez 2020-03-30 08:09:46 PDT
Comment on attachment 394908 [details]
Patch

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

> Source/WebCore/ChangeLog:8
> +        Instead of supporting sycnhronous IPC to terminate a service worker, SWServerWorker will asynchronously ask for the service worker to terminate.

Typo: sycnhronous

> Source/WebCore/workers/service/WorkerSWClientConnection.cpp:161
> +    notImplemented();

What's this?

> Source/WebCore/workers/service/server/SWServerWorker.cpp:126
> +void SWServerWorker::terminateCompleted()

startTermination -> terminationCompleted would be more consistent.
Comment 5 youenn fablet 2020-03-30 08:11:44 PDT
> > Source/WebCore/workers/service/WorkerSWClientConnection.cpp:161
> > +    notImplemented();
> 
> What's this?

We are not calling terminate from a worker but only from a document and for testing purposes.
Plan is to add support for it should we need to call this for testing from workers.
Comment 6 Chris Dumez 2020-03-30 08:17:44 PDT
(In reply to youenn fablet from comment #5)
> > > Source/WebCore/workers/service/WorkerSWClientConnection.cpp:161
> > > +    notImplemented();
> > 
> > What's this?
> 
> We are not calling terminate from a worker but only from a document and for
> testing purposes.
> Plan is to add support for it should we need to call this for testing from
> workers.

It looks like something that used to work and no longer does, aka a regression. How hard would it be to keep it working?
Comment 7 youenn fablet 2020-03-30 08:41:54 PDT
(In reply to Chris Dumez from comment #6)
> (In reply to youenn fablet from comment #5)
> > > > Source/WebCore/workers/service/WorkerSWClientConnection.cpp:161
> > > > +    notImplemented();
> > > 
> > > What's this?
> > 
> > We are not calling terminate from a worker but only from a document and for
> > testing purposes.
> > Plan is to add support for it should we need to call this for testing from
> > workers.
> 
> It looks like something that used to work and no longer does, aka a
> regression. How hard would it be to keep it working?

We could and it would be fairly simple (although we would add a Vector<callback>) but I do not think this is worth it.
Another option is to move this API to ServiceWorkerProvider so that only Documents would do that. I would tend to go this way in that case.
Comment 8 Chris Dumez 2020-03-30 08:44:44 PDT
Comment on attachment 394908 [details]
Patch

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

>> Source/WebCore/workers/service/WorkerSWClientConnection.cpp:161
>> +    notImplemented();
> 
> What's this?

This looks bad. I think we should either make it work or drop this code (assuming it is not currently useful). Going from something that works to something notImplemented() does not seem like the right thing to do.
Comment 9 youenn fablet 2020-03-30 09:05:48 PDT
Created attachment 394924 [details]
Patch
Comment 10 youenn fablet 2020-04-01 01:54:15 PDT
Ping review.
Comment 11 Chris Dumez 2020-04-01 12:34:28 PDT
Comment on attachment 394924 [details]
Patch

r=me
Comment 12 EWS 2020-04-02 00:54:20 PDT
Patch 394924 does not build
Comment 13 youenn fablet 2020-04-02 03:02:18 PDT
Created attachment 395256 [details]
Patch for landing
Comment 14 EWS 2020-04-02 04:00:59 PDT
Committed r259383: <https://trac.webkit.org/changeset/259383>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 395256 [details].