kmamal

#56061: fix: drop queued UvRunOnce tasks when polling stops

Merged
Created: Nov 25, 2026, 4:40:39 AM
Merged: Nov 30, 2026, 5:19:21 PM
10 comments
Target: main

Description of Change

Fixes #56060.

UvRunOnce tasks now carry the polling generation they were posted under, and StopPolling() bumps it, as in #54228.
A task from before the stop returns without running the loop or posting embed_sem_, so it cannot disturb the next page's embed thread.

I have not built or run this version, and I don't have a machine that can build electron.
I tested that one by patching it into the 45.5.0 release binary: with 5 ms busy work, 0 of 160 reloads stalled, against 76 of 160 without it.

The first version of this PR invalidated the weak pointers in StopPolling() instead.

Checklist

Release Notes

Notes: Fixed Node.js timers in the renderer stopping after a page reload.

Backports

44-x-y
In-flight
PR Number
#56111
Waiting to be merged
45-x-y
In-flight
PR Number
#56110
Waiting to be merged
46-x-y
In-flight
PR Number
#56112
Waiting to be merged

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