#56061: fix: drop queued UvRunOnce tasks when polling stops
Merged
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
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
-
npm testpasses - tests are changed or added
- PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, past tense, and no longer than 80 characters.
Release Notes
Notes: Fixed Node.js timers in the renderer stopping after a page reload.
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