Don't try to create cache2 dirs on and on when it once fails

RESOLVED FIXED in Firefox 51

Status

()

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: mayhemer, Assigned: michal)

Tracking

46 Branch
mozilla51
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox51 fixed)

Details

(Whiteboard: [necko-active])

Attachments

(1 attachment)

Based on https://crash-stats.mozilla.com/report/index/ffc71c4d-480f-4fe3-8a1c-c9ded2160421#allthreads which IMO demonstrates we on and on try to create the tree structure.  I bet in that report we call [1] and fail to wipe the caceh2/doomed dir from some reason.

This can fail from various reasons like out-of-space, network drive failures or also any preferences set to point the cache dir somewhere else than the local profile (people do that) where the target may be in a failed state.

Hence I think we should have a flag like "tree creation attempted" and never try it again, just work w/o the cache.  We could also try in intervals (once in a minute or so) but that is IMO just a nice-to-have.


[1] https://dxr.mozilla.org/mozilla-central/rev/86730d0a82093d705e44f33a34973d28b269f1ea/netwerk/cache2/CacheFileIOManager.cpp#3737
Whiteboard: [necko-active]
Posted patch patch v1Splinter Review
Attachment #8777794 - Flags: review?(honzab.moz)
Comment on attachment 8777794 [details] [diff] [review]
patch v1

Review of attachment 8777794 [details] [diff] [review]:
-----------------------------------------------------------------

::: netwerk/cache2/CacheFileIOManager.cpp
@@ +3716,5 @@
>    }
>  
>    nsresult rv;
>  
> +  mTreeCreationFailed = true;

maybe just add a note we drop the flag after the creation is sucesfully done.
Attachment #8777794 - Flags: review?(honzab.moz) → review+
Pushed by mnovotny@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/eac5c4bf002d
Don't try to create cache2 dirs on and on when it once fails, r=honzab
https://hg.mozilla.org/mozilla-central/rev/eac5c4bf002d
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.