|
|
Created:
8 years, 1 month ago by joth Modified:
8 years ago CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, android-webview-reviews_chromium.org Base URL:
http://git.chromium.org/chromium/src.git@master Visibility:
Public. |
DescriptionDon't shutdown render "process" in single process mode
This avoids races, and is no more overhead than the other many
long-lived browser threads that are kept about
BUG=158112
TEST=ran "chrome --single-process" on linux, open & close tabs.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=170644
Patch Set 1 #Patch Set 2 : move check to Release() #Patch Set 3 : rebase #Patch Set 4 : block renderer initiated shutdowns too #
Total comments: 3
Messages
Total messages: 15 (0 generated)
why is cleanup getting called in single process mode if you're not exiting? that seems like the cause of the bug, which this looks like it's masking over.
AIUI if an embedding app creates a WebContents instance, then destroys it, then some minutes later creates a new one. In the meantime, the render process would have (attempted to) shutdown. Should that scenario already be handled somewhere? On 29 October 2012 15:25, <jam@chromium.org> wrote: > why is cleanup getting called in single process mode if you're not > exiting? that > seems like the cause of the bug, which this looks like it's masking over. > > https://codereview.chromium.**org/11314014/<https://codereview.chromium.org/1... > > -- > > >
I see. perhaps Cleanup() shouldn't be called at all, i.e. the check should be in RenderProcessHostImpl::Release
That means it would need duplicating in RenderProcessHostImpl::OnDumpHandlesDone() (and anywhere else that might call it in future). Alternatively, as the Cleanup() call is already a no-op unless all widgets have been removed, we could rename it to MaybeCleanup() ? On 29 October 2012 19:23, <jam@chromium.org> wrote: > I see. perhaps Cleanup() shouldn't be called at all, i.e. the check should > be in > RenderProcessHostImpl::Release > > https://codereview.chromium.**org/11314014/<https://codereview.chromium.org/1... >
On 2012/10/29 20:01:33, joth wrote: > That means it would need duplicating in > RenderProcessHostImpl::OnDumpHandlesDone() > (and anywhere else that might call it in future). not really, since OnDumpHandlesDone is called in response to an IPC sent in Release(). so you only have to do it in Release, at line 1128 > Alternatively, as the Cleanup() call is already a no-op unless all widgets > have been removed, we could rename it to MaybeCleanup() ? > > > > > > On 29 October 2012 19:23, <mailto:jam@chromium.org> wrote: > > > I see. perhaps Cleanup() shouldn't be called at all, i.e. the check should > > be in > > RenderProcessHostImpl::Release > > > > > https://codereview.chromium.**org/11314014/%3Chttps://codereview.chromium.org...> > >
Moved the check to Release() Thanks
John: Any other comments ? Thanks
https://codereview.chromium.org/11314014/diff/27002/content/browser/renderer_... File content/browser/renderer_host/render_process_host_impl.cc (right): https://codereview.chromium.org/11314014/diff/27002/content/browser/renderer_... content/browser/renderer_host/render_process_host_impl.cc:1487: if (pending_views_ || num_active_views > 1 || run_renderer_in_process()) I did consider doing this check in render process instead, but ChildThread::OnProcessFinalRelease specifically comments the protocol is to always defer to the host (browser) opinion on this, and also, at this point we only want to alter the renderer behavior not all possible child processes.
lgtm
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/joth@chromium.org/11314014/27002
Message was sent while issue was closed.
Change committed as 170644
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/11314014/diff/27002/content/browser/re... File content/browser/renderer_host/render_process_host_impl.cc (right): https://chromiumcodereview.appspot.com/11314014/diff/27002/content/browser/re... content/browser/renderer_host/render_process_host_impl.cc:1130: // Keep the one renderer thread around forever in single process mode. I'm now seeing a DCHECK-failure when running `xvfb-run out/Debug/browser_tests --single-process --gtest_filter=DeclarativeApiTest.DeclarativeApi` at chrome/browser/profiles/profile_destroyer.cc:40: "DCHECK(hosts.empty() || profile->IsOffTheRecord());" It showed up about the time this CL was committed, but I haven't rolled back to be sure. Any suggestions for how to fix it?
Message was sent while issue was closed.
ah sorry for the inconvenience in having to track this down!. https://chromiumcodereview.appspot.com/11314014/diff/27002/content/browser/re... File content/browser/renderer_host/render_process_host_impl.cc (right): https://chromiumcodereview.appspot.com/11314014/diff/27002/content/browser/re... content/browser/renderer_host/render_process_host_impl.cc:1130: // Keep the one renderer thread around forever in single process mode. On 2012/12/14 22:10:51, Jeffrey Yasskin wrote: > I'm now seeing a DCHECK-failure when running `xvfb-run out/Debug/browser_tests > --single-process --gtest_filter=DeclarativeApiTest.DeclarativeApi` at > chrome/browser/profiles/profile_destroyer.cc:40: "DCHECK(hosts.empty() || > profile->IsOffTheRecord());" It showed up about the time this CL was committed, > but I haven't rolled back to be sure. Any suggestions for how to fix it? Good question. Most of the logic in the DestroyProfileWhenAppropriate() function is incorrect for single process mode, as single process does not support off the record. (It cannot: it only supports one profile as there's only one renderer). Also 'render' process shutdown was never reliable in single process mode (it was race prone). The simplest 'solution' (?) maybe to add "if (CommandLine::HasSwitch(kSingleProcess)) return;" prior to that DCHECK. (i.e. leak the profile too when running in unsupported mdoe) .. I haven't tried that though, maybe something else will break...
On Fri, Dec 14, 2012 at 2:34 PM, <joth@chromium.org> wrote: > ah sorry for the inconvenience in having to track this down!. No worries; --single-process doesn't have a continuous builder, so this sort of thing is bound to happen from time to time. It wasn't that hard to find, either. |