Closed Bug 1267195 Opened 4 years ago Closed 4 years ago

Another instance of 'indication of amount of content cache does not update when click [Clear Now] button preferences'

Categories

(Core :: Networking: Cache, defect)

45 Branch
x86_64
Windows 10
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox46 --- wontfix
firefox47 --- wontfix
firefox48 --- fixed
firefox49 --- fixed

People

(Reporter: abhilashmandaliya, Assigned: mayhemer)

References

Details

(Whiteboard: [necko-active])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0
Build ID: 20160407164938

Steps to reproduce:

tried to clear the cache using options->advanced->network->clear now. I am using version 45.0.2.


Actual results:

I had to click several time to clear the cache data.


Expected results:

it should clear all data in single click.
User Agent 	Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0
Build ID 	20160428030218

Reproduced on Firefox 45.0.2, Firefox 46 and Nightly 49 on Windows 10.
Status: UNCONFIRMED → NEW
Component: Untriaged → Networking: Cache
Ever confirmed: true
OS: Unspecified → Windows 10
Product: Firefox → Core
Hardware: Unspecified → x86_64
(In reply to Liviu Cirdei [:liviucirdei] from comment #1)
> User Agent 	Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0)
> Gecko/20100101 Firefox/49.0
> Build ID 	20160428030218
> 
> Reproduced on Firefox 45.0.2, Firefox 46 and Nightly 49 on Windows 10.

Can you tell me how exactly you reproduced this?  What did you expect and what happened?
Flags: needinfo?(liviu.cirdei)
I clicked "Clear Now" button and I expected to see all the cache being cleared at the first click. For example if I had 120 Mb of cache, on a click I expect to have 0 Mb of cache. Instead at first click the cache value decreases to another number (e.g 80mb), at a second click decreases again and so on until I get to 0 Mb of cache.
Flags: needinfo?(liviu.cirdei)
(In reply to Liviu Cirdei [:liviucirdei] from comment #3)
> I clicked "Clear Now" button and I expected to see all the cache being
> cleared at the first click. For example if I had 120 Mb of cache

Where do you see this number?  Generally speaking, where/how do you check how much space the cache occupies?

> , on a click
> I expect to have 0 Mb of cache. Instead at first click the cache value
> decreases to another number (e.g 80mb), at a second click decreases again
> and so on until I get to 0 Mb of cache.
Flags: needinfo?(liviu.cirdei)
Also a note that deletion is made asynchronously in background.  We first rename the cache2/entries dir to cache2/trash.nnnn and delete the trash dir in background.
I see the number of cache data going to Options->Advanced->Network --> Cached Web content.
Flags: needinfo?(liviu.cirdei)
(In reply to Liviu Cirdei [:liviucirdei] from comment #6)
> I see the number of cache data going to Options->Advanced->Network -->
> Cached Web content.

Aha, thanks.  OK, few more questions:
- I presume you refresh the Options page to update this number?
- how long after you pressed the Clear Now button did you do that?
- how many times?  (if more than once)
- does it ever show "Calculating..." instead of a number?
- after the number drops to say those 80MB, does it ever start dropping again by itself?
- how long did you wait before pressing the Clear Now button again?
- are there any web heavier pages (like facebook,gmail,news pages) being open during the deletion process?
- can you reproduce with a clear profile (or at least with no add-ons installed?)

Disregard comment 5 please.  We no longer do that for user initiated cache clear, but only for clear-cache-on-shutdown option turned on, I realized.
Flags: needinfo?(liviu.cirdei)
This is what I do:
1. Using a clean profile with no add-ons installed I open Firefox and open some pages to have some data in the cache. I use heavy pages like Facebook, gmail, youtube, etc
2. I open Options>Advanced Network page --> I see the cache number (if I refresh the page at this point I have the same number or sometimes the number increases).
4. I click "Clear Now" --> The number decreases instantly (I don't have to refresh the page) e.g from 100 mb to 80mb.
5. If I wait 30s-1 min the number remains the same (80 mb) and if I click again "Clear Now" it decreases again or in some cases it goes to 0 mb. Every time at least two clicks have to be made in order to have 0 mb of data cache. 

Also I can see "Calculating..." sometimes if I go to Options>Advanced>Network immediately after I opened the pages. And the pages are opened during the deletion process.
Flags: needinfo?(liviu.cirdei)
What happens when you:
- have data in the cache
- go to the Options/../Networking page (optionally wait for "Calculating..." text to become an actual number)
- click the Clear Now button
- close the Options page
- open Options/../Networking again

?
Flags: needinfo?(liviu.cirdei)
See Also: → 1066970
We just update the UI too soon.  This problem has recently been fixed and is now broken again.  Have to investigate what's exactly wrong.
Assignee: nobody → honzab.moz
Flags: needinfo?(liviu.cirdei)
Summary: cache can't be cleared in one click. It needs several clicks to clear 350 MB of cache data → Another instance of 'indication of amount of content cache does not update when click [Clear Now] button preferences'
Whiteboard: [necko-active]
Cause: on one place we were missing a check on the block flag, added.
Status: NEW → ASSIGNED
- we often call CacheIndex::ChangeState -> WRITING during deletion (a bug?) which was causing trigger of the notification to UI too early
- added check for the mAsyncGetDiskConsumptionBlocked flag also on that place
Attachment #8751777 - Flags: review?(michal.novotny)
Attachment #8751777 - Flags: review?(michal.novotny) → review+
(In reply to Honza Bambas (:mayhemer) from comment #12)
> - we often call CacheIndex::ChangeState -> WRITING during deletion (a bug?)

That's not a bug, but we could postpone writing index until eviction finishes.
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/8adc9b314e78
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
This is still an active problem with 47.0b7. It has been for more than a month. With a cache value of 1GB, it will usually take more than 2 dozen clicks of the <Clear Cache> button to fully clear the cache.
uplifts?
Flags: needinfo?(honzab.moz)
Duplicate of this bug: 1274759
(In reply to Patrick McManus [:mcmanus] from comment #17)
> uplifts?

Yep.
Flags: needinfo?(honzab.moz)
Comment on attachment 8751777 [details] [diff] [review]
1267195-cache-delete-block-notify-2.patch

Approval Request Comment
[Feature/regressing bug #]: HTTP cache v2
[User impact if declined]: Incorrect report of cache size when clearing cache from preferences (people falsely believe the mechanism doesn't work at all) ; bad UX
[Describe test coverage new/current, TreeHerder]: I think none
[Risks and why]: zero :)  the patch is super simple
[String/UUID change made/needed]: none
Attachment #8751777 - Flags: approval-mozilla-beta?
Attachment #8751777 - Flags: approval-mozilla-aurora?
When you say RESOLVED, I take it to mean that you have a fix in mind but just haven't pushed it out to users yet? I'm still seeing the problem on my end.
(In reply to Mike Aguilar from comment #21)
> When you say RESOLVED, I take it to mean that you have a fix in mind but
> just haven't pushed it out to users yet? I'm still seeing the problem on my
> end.

mike - its resolved on the target milestoe (which is firefox 49 nightly). are you testing with the latest nightly?

under "tracking-flags" on this bug you can see what other channels the fix has been ported to. (so far none, but there are requests in comment 20 to start that process.)
Patrick, I'm in Firefox 47. Nightly wasn't working with the CMS front-end that I was using for most of my work last I checked. When I get back from paying my bills, I'll see if it works with the WP CMS I use currently. I hope it does, since I actually prefer Nightly because it's faster.
Comment on attachment 8751777 [details] [diff] [review]
1267195-cache-delete-block-notify-2.patch

While this is not a recent regression (since Fx45), the fix seems simple enough, Aurora48+, Beta47+
Attachment #8751777 - Flags: approval-mozilla-beta?
Attachment #8751777 - Flags: approval-mozilla-beta+
Attachment #8751777 - Flags: approval-mozilla-aurora?
Attachment #8751777 - Flags: approval-mozilla-aurora+
Hi Mike, this fix should be in 47.0b9, which will be pushed to Beta channel on Friday 5/27. Could you please verify it then and let us know if this is fixed as expected? Thanks!
Flags: needinfo?(rivermikerat)
Yep. No problem.
Just did the 0b8 update and now it's sticking at 46k. Still requiring multiple clicks, but now won't clear all the way to zero. I'll update this thread when the 0b9 update comes out. I'm going to close FF and check to see if Nightly works correctly with my primary CMS platform.
This is hitting conflicts on uplift to beta. Can we get a rebased patch for it? I'll be landing the aurora uplift momentarily.
Flags: needinfo?(honzab.moz)
My WP CMS seems to work in Nightly 49.0a1, but the clear cache is getting stuck as 46k, no matter how many times I click it. First click causes the "Calculating....." to show and then it quickly drops to 46 from whatever it was.
Flags: needinfo?(rivermikerat)
Re beta conflicts: we need to uplift bug 1066970 first.
Flags: needinfo?(honzab.moz)
Comment on attachment 8751777 [details] [diff] [review]
1267195-cache-delete-block-notify-2.patch

Since I decided not to uplift bug 1066970, I am changing my decision on this one too. It is an old regression and now that we are entering RC week in 2 days, it's safer not to uplift this to Beta47.
Attachment #8751777 - Flags: approval-mozilla-beta+ → approval-mozilla-beta-
So you're just going to leave us hanging with this problem?
(In reply to Mike Aguilar from comment #33)
> So you're just going to leave us hanging with this problem?

There is actually no critical problem there.  It's just that the UI is incorrectly updated, your cache clears anyway.
How can we be sure of that? Not being able to trust what the UI is displaying to us seems pretty critical to me. If it's displaying that information incorrectly, how do we know it's not displaying other things correctly?

0b9 it's still an issue.
Duplicate of this bug: 1276682
You need to log in before you can comment on or make changes to this bug.