#52603: fix: exit gracefully when the display server connection is lost
Merged
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 testpasses - 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
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