Bug 221620 - Make Caches::writeRecord and Caches::readRecord more robust
Summary: Make Caches::writeRecord and Caches::readRecord more robust
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: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-09 11:53 PST by Alex Christensen
Modified: 2021-07-06 12:34 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.28 KB, patch)
2021-02-09 11:54 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (2.10 KB, patch)
2021-07-06 11:32 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2021-02-09 11:53:57 PST
Make Caches::writeRecord and Caches::readRecord more robust
Comment 1 Alex Christensen 2021-02-09 11:54:47 PST
Created attachment 419748 [details]
Patch
Comment 3 Radar WebKit Bug Importer 2021-02-16 11:54:16 PST
<rdar://problem/74400704>
Comment 4 youenn fablet 2021-07-06 02:08:04 PDT
Comment on attachment 419748 [details]
Patch

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

> Source/WebKit/ChangeLog:9
> +        Some events happen during teardown.  No reason to crash.

This seems ok to add a null check.
The underlying issue is probably that:
- we request space, which is an asynchronous operation as we may prompt user
- somehow we are requested to clear the caches
- user grants request space and we are back with no available storage.

I think this can be fixed by bailing out early in Caches::requestSpace callback in case m_isInitialized is false.
Comment 5 Alex Christensen 2021-07-06 10:41:04 PDT
r279597
Comment 6 Alex Christensen 2021-07-06 11:30:46 PDT
Reverted in r279599
Comment 7 Alex Christensen 2021-07-06 11:32:21 PDT
Reopening to attach new patch.
Comment 8 Alex Christensen 2021-07-06 11:32:23 PDT
Created attachment 432953 [details]
Patch
Comment 9 EWS 2021-07-06 12:34:15 PDT
Committed r279607 (239430@main): <https://commits.webkit.org/239430@main>

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