codebytere

#52956: fix: crash on windows when v8 posts a delayed worker task during shutdown

Merged
Created: Aug 18, 2026, 7:24:47 AM
Merged: Aug 19, 2026, 2:39:53 AM
3 comments
Target: main

Description of Change

Backports nodejs/node#61999.

NodePlatform's DelayedTaskScheduler closes its uv loop when the worker thread task runner shuts down, but a task still running on a platform worker thread (V8's MemoryPool release task re-posts itself with a delay) could call PostDelayedTask() after that. The call reaches uv_async_send() on a closed handle; on Windows libuv then fails PostQueuedCompletionStatus() against the destroyed completion port and calls uv_fatal_error(), so the process dies at quit.

Late posts are now dropped once the scheduler has been stopped, matching what PerIsolatePlatformData already does for foreground tasks. The patch can be removed once Electron rolls a Node release that contains nodejs/node#61999.

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes
  • PR title follows semantic commit guidelines

Release Notes

Notes: Fixed a crash on Windows when V8 posted a delayed worker task during shutdown.

Backports

42-x-y
Merged
PR Number
#53014
Merged At
Aug 19, 2026, 9:38:37 AM
Released In
Not yet
Release Date
Not yet
43-x-y
Merged
PR Number
#53013
Merged At
Aug 19, 2026, 9:55:47 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