Bug 113603 - "Empty cache..." clears the disk cache from each WebProcess
Summary: "Empty cache..." clears the disk cache from each WebProcess
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-03-29 13:29 PDT by Brady Eidson
Modified: 2013-03-31 01:51 PDT (History)
5 users (show)

See Also:


Attachments
Patch v1 (7.74 KB, patch)
2013-03-29 13:39 PDT, Brady Eidson
sam: review+
eflews.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2013-03-29 13:29:37 PDT
"Empty cache..." clears the disk cache from each WebProcess

This is silly - Just once from the network process will suffice.
Comment 1 Brady Eidson 2013-03-29 13:30:14 PDT
In radar <rdar://problem/12456652>
Comment 2 Brady Eidson 2013-03-29 13:39:16 PDT
Created attachment 195790 [details]
Patch v1
Comment 3 EFL EWS Bot 2013-03-29 13:42:43 PDT
Comment on attachment 195790 [details]
Patch v1

Attachment 195790 [details] did not pass efl-ews (efl):
Output: http://webkit-commit-queue.appspot.com/results/17227834
Comment 4 Early Warning System Bot 2013-03-29 13:46:14 PDT
Comment on attachment 195790 [details]
Patch v1

Attachment 195790 [details] did not pass qt-wk2-ews (qt):
Output: http://webkit-commit-queue.appspot.com/results/17323451
Comment 5 Sam Weinig 2013-03-29 13:54:24 PDT
Comment on attachment 195790 [details]
Patch v1

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

> Source/WebKit2/NetworkProcess/NetworkProcess.h:131
> +#if PLATFORM(MAC)
> +    dispatch_group_t m_clearCacheDispatchGroup;
> +#endif

Please add a FIXME and file a bug about doing this in a way that doesn't require an #ifdef.  e.g. Using a WorkQueue and BinarySemaphore.

> Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp:121
>      // FIXME (Multi-WebProcess): <rdar://problem/12239765> There is no need to relaunch all processes. One process to take care of persistent cache is enough.
>      context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebResourceCacheManager::ClearCacheForAllOrigins(cachesToClear));

Do we still want to send this if we are using the network process?
Comment 6 Brady Eidson 2013-03-29 14:15:56 PDT
(In reply to comment #5)
> (From update of attachment 195790 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=195790&action=review
> 
> > Source/WebKit2/NetworkProcess/NetworkProcess.h:131
> > +#if PLATFORM(MAC)
> > +    dispatch_group_t m_clearCacheDispatchGroup;
> > +#endif
> 
> Please add a FIXME and file a bug about doing this in a way that doesn't require an #ifdef.  e.g. Using a WorkQueue and BinarySemaphore.

Due to "popular request", I'm doing that now.

> 
> > Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp:121
> >      // FIXME (Multi-WebProcess): <rdar://problem/12239765> There is no need to relaunch all processes. One process to take care of persistent cache is enough.
> >      context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebResourceCacheManager::ClearCacheForAllOrigins(cachesToClear));
> 
> Do we still want to send this if we are using the network process?

Yes - WebProcesses still need to clear their individual memory caches.
Comment 7 Brady Eidson 2013-03-29 14:27:17 PDT
(In reply to comment #6)
> (In reply to comment #5)
> > (From update of attachment 195790 [details] [details])

> > 
> > Please add a FIXME and file a bug about doing this in a way that doesn't require an #ifdef.  e.g. Using a WorkQueue and BinarySemaphore.
> 
> Due to "popular request", I'm doing that now.
> 

Or, maybe not.  A binary semaphore isn't good enough.  We'd need a counting semaphore.  That's why the WebResourceCacheManager version of this code uses dispatch_group;  It has to handle multiple requests to clear and wait for all of them to complete.

I'll definitely add the FIXME about this but WorkQueue and/or Semaphore improvements are definitely needed before they can be a solution to this problem.
Comment 8 Brady Eidson 2013-03-29 14:31:02 PDT
http://trac.webkit.org/changeset/147251
Comment 9 Csaba Osztrogonác 2013-03-30 02:03:17 PDT
(In reply to comment #8)
> http://trac.webkit.org/changeset/147251

And buildfix for !ENABLE(NETWORK_PROCESS) landed in
http://trac.webkit.org/changeset/147268.

Otherwise are you planning to review network process patches to let
enable network process for other ports? https://bugs.webkit.org/show_bug.cgi?id=108832

Positive and/or negative review would be welcome ...
Comment 10 Brady Eidson 2013-03-30 09:51:29 PDT
(In reply to comment #9)
> (In reply to comment #8)
> > http://trac.webkit.org/changeset/147251
> 
> And buildfix for !ENABLE(NETWORK_PROCESS) landed in
> http://trac.webkit.org/changeset/147268.
> 
> Otherwise are you planning to review network process patches to let
> enable network process for other ports? https://bugs.webkit.org/show_bug.cgi?id=108832
> 
> Positive and/or negative review would be welcome ...

From https://bugs.webkit.org/show_bug.cgi?id=108832 - "Let's do this in smaller steps" seems like extremely good feedback!!!
Comment 11 Csaba Osztrogonác 2013-03-31 01:51:08 PDT
> From https://bugs.webkit.org/show_bug.cgi?id=108832 - "Let's do this in smaller steps" seems like extremely good feedback!!!

Balázs - the author of the patch - said it, and then filed many
bug reports for it 1.5 months before. But after it, I can't see
any feedback from the WebKit2 authors.