watch: strip watch flags from NODE_OPTIONS in child process#62143
Open
marcopiraccini wants to merge 1 commit intonodejs:mainfrom
Open
watch: strip watch flags from NODE_OPTIONS in child process#62143marcopiraccini wants to merge 1 commit intonodejs:mainfrom
marcopiraccini wants to merge 1 commit intonodejs:mainfrom
Conversation
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62143 +/- ##
==========================================
- Coverage 89.65% 89.65% -0.01%
==========================================
Files 676 676
Lines 206543 206543
Branches 39547 39548 +1
==========================================
- Hits 185184 185178 -6
- Misses 13480 13487 +7
+ Partials 7879 7878 -1 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
NODE_OPTIONScontains--watch, the watch mode parent process spawns a child that inherits the sameNODE_OPTIONS, causing the child to also enter watch mode and spawn another child, creating an infinite loop of process spawning.This PR strips watch-related flags (
--watch,--watch-path,--watch-preserve-output,--watch-kill-signal) fromNODE_OPTIONSbefore passing the environment to the child process. This mirrors the existing logic that already strips these flags fromprocess.execArgv.Non-watch flags in
NODE_OPTIONS(e.g.,--max-old-space-size) are preserved.Fixes: #61740
This is actually similar to #61838 but more "surgical", it just avoid propagating
watchflags.