Bug 226589

Summary: Make WebIDBServer use WorkQueue instead of Thread
Product: WebKit Reporter: Sihui Liu <sihui_liu>
Component: WebKit Misc.Assignee: Sihui Liu <sihui_liu>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, cdumez, ggaren, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing
none
Patch for landing none

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>