chore: cleanup upstreamed changes - #53177
Conversation
| if (!process_type.empty()) { | ||
| // Have Windows shut child processes down after the browser at logoff and | ||
| // shutdown, as Chrome does, so the browser never watches them die. | ||
| ::SetProcessShutdownParameters(0x280 - 1, SHUTDOWN_NORETRY); | ||
| } |
There was a problem hiding this comment.
I think this is correct but I'm not 100% sure, so raising as a question:
Removing this partially reintroduces the problem: upstream handles this now, but only processes that upstream knows about. This doesn't get called anymore for Electron’s custom --type=relauncher, so the browser and relauncher will share 0x280 and have an unspecified shutdown order if Windows shuts down during an Electron relaunch.
Even if this is valid, it's an edge case. But it's an easy one to avoid by copying this code into shell/browser/relauncher_win.cc:
diff --git a/shell/browser/relauncher_win.cc b/shell/browser/relauncher_win.cc
--- a/shell/browser/relauncher_win.cc
+++ b/shell/browser/relauncher_win.cc
@@ -69,6 +69,11 @@ StringType ArgvToCommandLineString(const StringVector& argv) {
}
void RelauncherSynchronizeWithParent() {
+ // Ensure the browser is shut down before the relauncher, matching Content's
+ // handling of its recognized subprocess types.
+ ::SetProcessShutdownParameters(0x280 - 1, SHUTDOWN_NORETRY);
+
base::Process process = base::Process::Current();
base::win::ScopedHandle parent_process(
GetParentProcessHandle(process.Handle()));There was a problem hiding this comment.
Good call on the relauncher type, the original change was added to suppress the gpu crash #52604. Our relauncher on windows already waits on the parent process to shutdown I don't see any harm making it explicit but also don't see the need given its intermediary lifetime.
@codebytere thoughts ?
48102b2 to
0ac8a82
Compare
Description of Change
Followup to some of the CLs landed in this current roll, thanks to the work from @codebytere
Release Notes
Notes: none