Skip to content

chore: cleanup upstreamed changes - #53177

Open
deepak1556 wants to merge 4 commits into
mainfrom
robo/debt_cleanup
Open

chore: cleanup upstreamed changes#53177
deepak1556 wants to merge 4 commits into
mainfrom
robo/debt_cleanup

Conversation

@deepak1556

Copy link
Copy Markdown
Member

Description of Change

Followup to some of the CLs landed in this current roll, thanks to the work from @codebytere

Release Notes

Notes: none

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Aug 25, 2026
@ckerr ckerr added the backport-check-skip Skip trop's backport validity checking label Aug 25, 2026
@electron-cation electron-cation Bot added new-pr 🌱 PR opened recently and removed new-pr 🌱 PR opened recently labels Aug 25, 2026
Comment on lines -210 to -214
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);
}

@ckerr ckerr Aug 25, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()));

@deepak1556 deepak1556 Aug 25, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

Base automatically changed from roller/chromium/main to main August 25, 2026 17:26
@deepak1556
deepak1556 marked this pull request as ready for review August 26, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-check-skip Skip trop's backport validity checking no-backport semver/none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants