codebytere

#52603: fix: exit gracefully when the display server connection is lost

Merged
Created: Aug 2, 2026, 10:00:59 PM
Merged: Aug 6, 2026, 10:17:01 PM
4 comments
Target: main

Description of Change

On Linux the Ozone platform runs the browser-provided shutdown callback when the X11/Wayland connection breaks (X server exit, session logout, compositor restart). Ours went straight to LOG(FATAL), so every display-server teardown produced a crash report. Chrome's equivalent runs chrome::SessionEnding() first and only fatals if that fails to end the process.

Add Browser::ExitWithCode() (the app.exit() path, callable from native code), have the callback force-exit like app.exit(0), and keep the fatal as a 10-second delayed watchdog for the case where exiting hangs.

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes
  • tests are changed or added
  • relevant documentation, tutorials, templates and examples are changed or are not needed

Release Notes

Notes: Fixed a crash report when the X server or Wayland compositor exits while an app is running.

Backports

42-x-y
Merged
PR Number
#52686
Merged At
Aug 7, 2026, 10:03:12 AM
Released In
Not yet
Release Date
Not yet
43-x-y
Merged
PR Number
#52685
Merged At
Aug 7, 2026, 10:59:44 AM
Released In
Not yet
Release Date
Not yet
44-x-y
Merged
PR Number
#52684
Merged At
Aug 7, 2026, 10:06:06 AM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron