Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(714)

Issue 2038633002: Renderers should immediately exit on failure to send an IPC to the browser.

Created:
4 years, 6 months ago by erikchen
Modified:
4 years, 6 months ago
Reviewers:
Avi (use Gerrit), jam
CC:
chromium-reviews, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, jam, darin-cc_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Renderers should immediately exit on failure to send an IPC to the browser. In the fast shutdown path, the browser kills the IPC channel without informing the renderer. This means that any IPC message might fail. Either every sender of any IPC message needs to gracefully handle failures, or else the process needs to exit immediately. Since the renderer is no longer expected to have any user-visible effects, or make any persistent changes, exit immediately. BUG=615121

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -0 lines) Patch
M content/renderer/render_thread_impl.cc View 1 chunk +9 lines, -0 lines 1 comment Download

Messages

Total messages: 8 (3 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2038633002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2038633002/1
4 years, 6 months ago (2016-06-02 18:25:23 UTC) #2
erikchen
avi, jam: Please review. This is the more generic version of https://bugs.chromium.org/p/chromium/issues/detail?id=615121#c47, which was added ...
4 years, 6 months ago (2016-06-02 18:26:18 UTC) #4
Avi (use Gerrit)
I'm actually kinda surprised we don't already do this. LGTM from me; John's out this ...
4 years, 6 months ago (2016-06-02 18:40:02 UTC) #5
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_gn_rel on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_rel/builds/121272) win_chromium_x64_rel_ng on ...
4 years, 6 months ago (2016-06-02 19:52:57 UTC) #7
jam
4 years, 6 months ago (2016-06-06 20:25:52 UTC) #8
trying to understand this better:

So this only matters for sync IPCs, as async always return true from Send. The
other change (https://codereview.chromium.org/2028833003/) is happening because
the IPC sending is happening on different threads than the main/IO, so there is
a race condition between when the IO thread notices that the channel
disconnected and the main thread quitting (in ChildThreadImpl::OnChannelError()
). During that race, the other threads requesting memory will see the failed
sync send.

This change addresses the race condition on the main thread, in between the main
thread (on Windows; on POSIX the suicide listener sees it on IO thread) noticing
the connection error and doing a quit on idle on the message loop?

https://codereview.chromium.org/2038633002/diff/1/content/renderer/render_thr...
File content/renderer/render_thread_impl.cc (right):

https://codereview.chromium.org/2038633002/diff/1/content/renderer/render_thr...
content/renderer/render_thread_impl.cc:984: exit(EXIT_SUCCESS);
seems like this should match exit(0) in SuicideOnChannelErrorFilter . I realize
both are 0, but we should be consistent in both of them.

Why isn't this in ChildThreadImpl::Send so that it's done for all child
processes instead of just renderers?

With this change,
https://codereview.chromium.org/2028833003/diff/60001/content/child/child_sha...
should that move to thread_safe_sender.cc's Send method instead?

Powered by Google App Engine
This is Rietveld 408576698