Bug 226589 - Make WebIDBServer use WorkQueue instead of Thread
Summary: Make WebIDBServer use WorkQueue instead of Thread
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sihui Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-03 10:34 PDT by Sihui Liu
Modified: 2021-06-03 23:36 PDT (History)
5 users (show)

See Also:


Attachments
Patch (14.53 KB, patch)
2021-06-03 10:46 PDT, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch for landing (14.97 KB, patch)
2021-06-03 14:23 PDT, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch for landing (15.15 KB, patch)
2021-06-03 23:08 PDT, Sihui Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sihui Liu 2021-06-03 10:34:04 PDT
...
Comment 1 Sihui Liu 2021-06-03 10:46:06 PDT
Created attachment 430480 [details]
Patch
Comment 2 Chris Dumez 2021-06-03 12:26:37 PDT
Comment on attachment 430480 [details]
Patch

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

> Source/WebKit/NetworkProcess/IndexedDB/WebIDBServer.cpp:67
> +        auto origins = m_server->getOrigins();

Why?

> Source/WebKit/NetworkProcess/IndexedDB/WebIDBServer.cpp:-394
> -    tryClose();

Why don't we call this anymore? This is the kind of thing function-level changelogs are for.
Comment 3 Sihui Liu 2021-06-03 12:53:17 PDT
Comment on attachment 430480 [details]
Patch

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

>> Source/WebKit/NetworkProcess/IndexedDB/WebIDBServer.cpp:67
>> +        auto origins = m_server->getOrigins();
> 
> Why?

Oops should remove

>> Source/WebKit/NetworkProcess/IndexedDB/WebIDBServer.cpp:-394
>> -    tryClose();
> 
> Why don't we call this anymore? This is the kind of thing function-level changelogs are for.

This was added to aggressively destroy WebIDBServer to ensure thread exits. It's possible a new connection is immediately created (web page is reloaded after web process crashes) after we close WebIDBServer, and we will create a new WebIDBServer. In this case both servers may access the same database on different work queues, unless we wait until the old WebIDBServer is destroyed before creating new one. To make things easy, we can just keep the WebIDBServer until session is destroyed.

Will add to changelog.
Comment 4 Sihui Liu 2021-06-03 14:23:53 PDT
Created attachment 430498 [details]
Patch for landing
Comment 5 EWS 2021-06-03 15:29:46 PDT
Tools/Scripts/svn-apply failed to apply attachment 430498 [details] to trunk.
Please resolve the conflicts and upload a new patch.
Comment 6 Sihui Liu 2021-06-03 23:08:09 PDT
Created attachment 430546 [details]
Patch for landing
Comment 7 EWS 2021-06-03 23:35:45 PDT
Committed r278449 (238469@main): <https://commits.webkit.org/238469@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430546 [details].
Comment 8 Radar WebKit Bug Importer 2021-06-03 23:36:21 PDT
<rdar://problem/78856484>