Bug 195024 - Network Process is put to suspended when holding locked IndexedDB files
Summary: Network Process is put to suspended when holding locked IndexedDB files
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: Sihui Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-02-25 16:11 PST by Sihui Liu
Modified: 2019-02-27 10:55 PST (History)
8 users (show)

See Also:


Attachments
Patch (17.64 KB, patch)
2019-02-25 16:47 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch (17.37 KB, patch)
2019-02-26 13:52 PST, 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 2019-02-25 16:11:53 PST
Network process should take a background task assertion so that it won't get suspended when it's holding locked files.
Comment 1 Sihui Liu 2019-02-25 16:19:46 PST
<rdar://problem/45194169>
Comment 2 Sihui Liu 2019-02-25 16:47:18 PST
Created attachment 362943 [details]
Patch
Comment 3 Geoffrey Garen 2019-02-25 17:06:34 PST
Comment on attachment 362943 [details]
Patch

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

> Source/WebCore/ChangeLog:9
> +        We found network process was put to suspension when IDBDatabase was being closed in the background database

was put to suspension when => was suspended while

> Source/WebCore/Modules/indexeddb/server/IDBServer.cpp:47
> +    WTFReportBacktrace();

Please revert.

> Source/WebCore/Modules/indexeddb/server/IDBServer.cpp:53
> +    WTFReportBacktrace();

Please revert.

> Source/WebCore/Modules/indexeddb/server/IDBServer.cpp:69
> +    , m_notifyProcessFunction(WTFMove(notifyProcessFunction))

I'm having a hard time understanding what this function pointer does. I think it needs a better name. Can you describe it in words, and maybe we can come up with a name?
Comment 4 Sihui Liu 2019-02-26 10:16:53 PST
(In reply to Geoffrey Garen from comment #3)
> Comment on attachment 362943 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=362943&action=review
> 
> > Source/WebCore/ChangeLog:9
> > +        We found network process was put to suspension when IDBDatabase was being closed in the background database
> 
> was put to suspension when => was suspended while
> 
Okay.

> > Source/WebCore/Modules/indexeddb/server/IDBServer.cpp:47
> > +    WTFReportBacktrace();
> 
> Please revert.
> 
> > Source/WebCore/Modules/indexeddb/server/IDBServer.cpp:53
> > +    WTFReportBacktrace();
> 
> Please revert.
> 
Oops, sure.

> > Source/WebCore/Modules/indexeddb/server/IDBServer.cpp:69
> > +    , m_notifyProcessFunction(WTFMove(notifyProcessFunction))
> 
> I'm having a hard time understanding what this function pointer does. I
> think it needs a better name. Can you describe it in words, and maybe we can
> come up with a name?

This function pointer let IDBServer send a message via connection of NetworkProcess, since IDBServer doesn't have a NetworkProcess member. That's why I called it notify(Network)ProcessFunction...
Comment 5 Geoffrey Garen 2019-02-26 13:22:04 PST
Comment on attachment 362943 [details]
Patch

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

> Source/WebCore/Modules/indexeddb/server/IDBServer.h:144
> +    WTF::Function<void(bool)> m_notifyProcessFunction;

Let's call this m_isClosingDatabaseCallback.

> Source/WebCore/Modules/indexeddb/server/IDBServer.h:145
> +    PAL::HysteresisActivity m_hysteresis;

Let's call this m_isClosingDatabaseHysteresis.

Would that make sense?
Comment 6 Sihui Liu 2019-02-26 13:43:45 PST
(In reply to Geoffrey Garen from comment #5)
> Comment on attachment 362943 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=362943&action=review
> 
> > Source/WebCore/Modules/indexeddb/server/IDBServer.h:144
> > +    WTF::Function<void(bool)> m_notifyProcessFunction;
> 
> Let's call this m_isClosingDatabaseCallback.
> 
Okay.

> > Source/WebCore/Modules/indexeddb/server/IDBServer.h:145
> > +    PAL::HysteresisActivity m_hysteresis;
> 
> Let's call this m_isClosingDatabaseHysteresis.
> 
Okay.

> Would that make sense?
>
Looks good.
Comment 7 Sihui Liu 2019-02-26 13:52:18 PST
Created attachment 363018 [details]
Patch
Comment 8 Geoffrey Garen 2019-02-26 14:15:27 PST
Comment on attachment 363018 [details]
Patch

r=me
Comment 9 WebKit Commit Bot 2019-02-27 10:55:13 PST
Comment on attachment 363018 [details]
Patch

Clearing flags on attachment: 363018

Committed r242136: <https://trac.webkit.org/changeset/242136>
Comment 10 WebKit Commit Bot 2019-02-27 10:55:14 PST
All reviewed patches have been landed.  Closing bug.