Skip to content

fix: recover network requests after Network Service restart - #49887

Merged
jkleinsc merged 4 commits into
mainfrom
network-recovery
Feb 25, 2026
Merged

jkleinsc merged 4 commits into
mainfrom
network-recovery

Conversation

@codebytere

@codebytere codebytere commented Feb 20, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Closes #49572.

When the Network Service process crashes and restarts, cached URLLoaderFactory and HostResolver instances become stale, causing all subsequent net.fetch requests in both the main process and utility
processes to fail with net::ERR_FAILED.

This adds a Network Service restart notification mechanism via SystemNetworkContextManager that resets stale factories in ElectronBrowserContext and sends fresh ones to utility processes via a new UpdateURLLoaderFactory Mojo IPC. URLLoaderBundle is refactored to implement SharedURLLoaderFactory directly, allowing replacement of the underlying remote without invalidating existing consumer references.

Checklist

Release Notes

Notes: Fixed an issue where net.fetch() requests in the main process and utility processes would permanently fail with net::ERR_FAILED after the Network Service process crashed and restarted.

@codebytere codebytere added semver/patch backwards-compatible bug fixes no-backport labels Feb 20, 2026
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Feb 20, 2026
@codebytere
codebytere force-pushed the network-recovery branch 2 times, most recently from 8acfa15 to bfda6e2 Compare February 20, 2026 12:50
@codebytere
codebytere marked this pull request as ready for review February 20, 2026 15:07
@codebytere
codebytere force-pushed the network-recovery branch 2 times, most recently from bf9f4a0 to a1fbf7e Compare February 20, 2026 15:09
@deepak1556

deepak1556 commented Feb 20, 2026 •

Copy link
Copy Markdown
Member

Thanks for tackling this, there was already an effort for this #49215, can you merge your changes onto the original PR so we can also give the author the credits. I prefer the code style in this PR

Only one additional change, instead of an internal event can you rely on the following two content apis https://source.chromium.org/chromium/chromium/src/+/main:content/browser/network_service_instance_impl.h;l=68-75 via our testing module https://github.com/electron/electron/blob/main/shell/common/api/electron_api_testing.cc

@codebytere

codebytere commented Feb 21, 2026 •

Copy link
Copy Markdown
Member Author

@deepak1556 i can add co-author credit here, but i was concerned in the original PR that the committer was different: https://github.com/electron/electron/pull/49215/commits. That PR also doesn't address utility process functionality from what i understand.

@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Feb 21, 2026
Comment thread shell/services/node/node_service.h Resolved
@codebytere
codebytere force-pushed the network-recovery branch 5 times, most recently from 3b6d0c5 to 4b8024a Compare February 23, 2026 12:08
Comment thread shell/browser/api/electron_api_app.cc Resolved
Comment thread shell/browser/api/electron_api_app.h Resolved
Comment thread shell/services/node/node_service.cc Resolved

@deepak1556 deepak1556 left a comment

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.

Thanks!

@jkleinsc
jkleinsc merged commit 94aa90b into main Feb 25, 2026
57 checks passed
@jkleinsc
jkleinsc deleted the network-recovery branch February 25, 2026 17:53
@release-clerk

release-clerk Bot commented Feb 25, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed an issue where net.fetch() requests in the main process and utility processes would permanently fail with net::ERR_FAILED after the Network Service process crashed and restarted.

kycutler pushed a commit to kycutler/electron that referenced this pull request Feb 26, 2026
…#49887)

* fix: recover network requests after Network Service restart

* chore: reuse implementation

* chore: make linter happy

* chore: fix lint

---------

Co-authored-by: deepak1556 <[email protected]>
Co-authored-by: Charles Kerr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-backport semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Requests continue to fail after Network Service restarts

4 participants