HiI'm now thinking about a way to unconditionally shut down the renderer by SIGKILL (i.e., unconditionally use FastShutdownIfPossible()) and thus entirely remove the normal shutdown sequence (i.e., remove RenderThreadImpl::Shutdown). Per the discussion on the blink-dev@ thread, this seems like a right direction to fix various crashes we've been hitting in the shutdown sequence.Before diving into the implementation details, I'd like to understand the concerns of removing the shutdown sequence. Let me ask a couple of questions:- Do you know any tests that depend on the shutdown sequence?- It is interesting that the only case where we currently fail at FastShutdownIfPossible() is when we have workers (It looks like that GetContentClient()->browser()->IsFastShutdownPossible() and SuddenTerminationAllowed() always return true). Do you know why we need the shutdown sequence if we have workers?
- Should we aim at entirely removing RenderThreadImpl::Shutdown()? Or should we aim at removing only blink::shutdown()?- Do you have any other concern?--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jxu3ZUnrNHStG3fy%2BsuX8%2BeyW2uscmj_gdEJ3_A400DAQ%40mail.gmail.com.
2016-07-22 18:56 GMT+09:00 Kentaro Hara <har...@chromium.org>:HiI'm now thinking about a way to unconditionally shut down the renderer by SIGKILL (i.e., unconditionally use FastShutdownIfPossible()) and thus entirely remove the normal shutdown sequence (i.e., remove RenderThreadImpl::Shutdown). Per the discussion on the blink-dev@ thread, this seems like a right direction to fix various crashes we've been hitting in the shutdown sequence.Before diving into the implementation details, I'd like to understand the concerns of removing the shutdown sequence. Let me ask a couple of questions:- Do you know any tests that depend on the shutdown sequence?- It is interesting that the only case where we currently fail at FastShutdownIfPossible() is when we have workers (It looks like that GetContentClient()->browser()->IsFastShutdownPossible()
and SuddenTerminationAllowed() always return true). Do you know why we need the shutdown sequence if we have workers?This logic was added by this CL not to run the shutdown sequence but to prolong life of a renderer process hosting out-of-process workers (ie. SharedWorker and ServiceWorker) until all workers are gone (+horo@, kinuko@)
----- Should we aim at entirely removing RenderThreadImpl::Shutdown()? Or should we aim at removing only blink::shutdown()?- Do you have any other concern?--Kentaro Hara, Tokyo, Japan
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jxu3ZUnrNHStG3fy%2BsuX8%2BeyW2uscmj_gdEJ3_A400DAQ%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABj5diOOpQPj0GcgHFc8yAQV1TfyEmkxk13ofyUE%3DvsC6YS4Ng%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CALhVsw1dYDBp9eF1sRwGroV0ychr-tQ4CXHdX5JQ_WO2hCAbBQ%40mail.gmail.com.
Overall, I support simplifying things so that shutdown is always browser-initiated.What happens now -- with the renderer and the browser process both sort of responsible for triggering the death -- is quite a puzzle, and it's not clear that we get all the interactions right. For example, because RenderProcessHostImpl::OnShutdownRequest() doesn't mutate any state in the RPH, it's not clear that there's anything to suppress (pending_views_ || GetActiveViewCount() > 0) transitioning from false to true immediately after we tell the child process to start terminating.The CPU sent closing/freeing/unregistering objects right before process shutdown is essentially wasteful, since the system needs to be resilient against unclean termination anyway. One thing we can, at least in theory, gain from clean renderer exit is a kind of proof-of-correctness in the program as a whole: inconsistencies (leaks, dangling references) that would cause errors during shutdown could be problems for normal operation too. There is also the matter of flushing any accumulated stats/tracing/histograms, which I'm not sure how good a job we do of presently.
But for the most part, the user -- who doesn't care about any of that stuff -- would be best served by a simple SIGKILL.> SuddenTerminationAllowed() always return true
Is it true that |RenderProcessHostImpl::sudden_termination_allowed_| is always true? SuddenTerminationChanged can be triggered by RenderProcessHostMsg_SuddenTerminationChanged, and it seems like RendererBlinkPlatformImpl::suddenTerminationChanged, which sends that message, has quite a few callers, including when an unload handler is present.
> testsThere's a chrome browsertest, FastShutdown.SlowTermination, that makes sure that document.cookie assignment from inside a page's unload handler make it to the cookie store. We ought to write a similar test for navigator.sendBeacon, which is an important thing to work from within an unload handler.When looking at code history, I noticed http://crbug.com/461530, a fullscreen bug that appeared during a prior attempt to refactor sudden termination. That scenario may be worth considering.
I'm not very familiar with WebView behavior but there are compatibility problems. Unload behavior is hugely inconsistent esp. on Android, that's one of the reason we want to kill unload handler completely (c.f. https://crbug.com/154321 tells about it, and Ilya has a nice blog post about this)-- while handling unload event is still somewhat popular on Web. Shared worker is not supported in WebView, and Service worker support is being requested but I don't think we're officially supporting it yet.Btw SuddenTerminationAllowed() is also used to keep a renderer around while background storage request is being processed, e.g. data is being transferred from renderer to browser (so that they can be persisted on disk or can be shared with / transferred to another renderer). I don't know how they work on WebView, and I suppose there're still cases where we could lose such data in other sudden-death cases.On Tue, Jul 26, 2016 at 3:12 AM, Kentaro Hara <har...@chromium.org> wrote:WebView is unconditionally killing the renderer by SIGKILL. Why doesn't it cause compatibility problems for unload handlers, out-of-process workers etc?
Thanks all!
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABg10jxu3ZUnrNHStG3fy%2BsuX8%2BeyW2uscmj_gdEJ3_A400DAQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CABj5diOOpQPj0GcgHFc8yAQV1TfyEmkxk13ofyUE%3DvsC6YS4Ng%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CALhVsw1dYDBp9eF1sRwGroV0ychr-tQ4CXHdX5JQ_WO2hCAbBQ%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--Kentaro Hara, Tokyo, Japan
--Kentaro Hara, Tokyo, Japan