Instantly get rid of unreferenced and doomed HTTP cache entries

RESOLVED FIXED in Firefox 47

Status

()

defect
--
minor
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: mayhemer, Assigned: mayhemer)

Tracking

Trunk
mozilla47
Points:
---

Firefox Tracking Flags

(firefox47 fixed)

Details

(Whiteboard: [necko-active])

Attachments

(1 attachment)

+also drop any I/O on them (except closing/erasing a file when present and not after shutdown)

When CacheEntry::mHandlesCount == 0 && mIsDoomed -> tell the cache file to "kill" itself instantly (= no (meta)data writes, just wipe the file existence, if there has even been a file physically open).
Blocks: 1215970
Whiteboard: [necko-active]
The main motivation here is the Skype bug 1215970.  But according the most recent findings, this may not be an immediate problem, turning this bug to just a small optimization.
No longer blocks: 1215970
Severity: normal → minor
Whiteboard: [necko-active] → [necko-would-take]
Tho... I can see this happening often enough to get my attention when scrolling timelines on facebook.  So, it may be worth doing.
Assignee: nobody → honzab.moz
Status: NEW → ASSIGNED
Posted patch v1Splinter Review
- CacheFileIOListener has a new virtual getter IsKilled
- that one is reimplemented by CacheFile
- returns true after last outer reference to CacheEntry has been released and that entry has also been doomed
- most of the operations of IO manager check for this flag being set (on main thread and in *Internal parts, and if killed, open, truncate, read and write are completely bypassed
- cache file input stream now also keeps an outer reference to its cache entry so that we don't kill a file whom input stream is life

This saves doing IO (mainly early metadata write) on cache files that will never be used (are unreachable and doomed).


Among other patches:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=ee1b8b5b1464
Attachment #8719042 - Flags: review?(michal.novotny)
Blocks: 1215970
No longer blocks: 1215970
Attachment #8719042 - Flags: review?(michal.novotny) → review+
Keywords: checkin-needed
Whiteboard: [necko-would-take] → [necko-active]
https://hg.mozilla.org/mozilla-central/rev/74c396a8252c
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in before you can comment on or make changes to this bug.