You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
watch: cancel pending restart on shutdown - #63383
Fixes a watch mode shutdown race where a pending debounced file change could still emit after FilesWatcher.clear() closed the active watchers. That allowed watch mode to restart the child process after shutdown had already started, which could leave out/Release/node --watch --inspect processes behind and fail CI’s leftover-process check.
This cancels the pending debounce timer during watcher cleanup and makes watched child exit handling stable across overlapping restart/shutdown paths.
$ python3 tools/test.py -J --mode=release \ parallel/test-watch-mode-files_watcher-clear \ sequential/test-watch-mode-inspect \ parallel/test-watch-mode-files_watcher=== release test-watch-mode-files_watcher-clear ===Path: parallel/test-watch-mode-files_watcher-clearnode:assert:173 throw err; ^AssertionError [ERR_ASSERTION]: function should not have been called at file:///Users/trivikram/workspace/node/test/parallel/test-watch-mode-files_watcher-clear.mjs:45called with arguments: { owners: SafeSet(0) {}, eventType: 'change' } at FilesWatcher.mustNotCall (/Users/trivikram/workspace/node/test/common/index.js:567:12) at FilesWatcher.emit (node:events:509:20) at Timeout._onTimeout (node:internal/watch_mode/files_watcher:104:12) at listOnTimeout (node:internal/timers:605:17) at process.processTimers (node:internal/timers:541:7) {
Fixes a watch mode shutdown race where a pending debounced file change could still emit after
FilesWatcher.clear()closed the active watchers. That allowed watch mode to restart the child process after shutdown had already started, which could leaveout/Release/node --watch --inspectprocesses behind and fail CI’s leftover-process check.This cancels the pending debounce timer during watcher cleanup and makes watched child exit handling stable across overlapping restart/shutdown paths.
Noticed while examining flaky tests in ubuntu2404_sharedlibs_shared_x64/56356
Testing
The updated unit tests were run before/after
Before