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.
This changes the conditions behind
error.killed
.a)
childProcess.kill()
was successfully calledtrue
in core Node.js,true
inexeca
. Unchanged.b)
process.kill(childProcess.pid)
was calledfalse
in core Node.js,false
inexeca
. Unchanged.Ideally this should be
true
, but I am not sure that's possible. The issue is that Windows usesexitCode: 1
and nosignal
, while Unix usesexitCode: null
andsignal: 'SIGTERM'
. The difference is due to Node.js emulating termination signals on Windows. On Windows (with justexitCode: 1
) it seems impossible to know whether the child process was killed externally.One consequence of this is: while
process.kill(childProcess.pid)
will seterror.killed
tofalse
on both Windows and Unix, the error message will be different:was killed with SIGTERM
on Unix,failed with exit code 1
on Windows.c)
timeout
was reachedtrue
in core Node.js,true
inexeca
. Changed tofalse
with this PR. We haveerror.timedOut
for this. This makes those boolean error properties orthogonal to each other.d)
maxBuffer
was reachedtrue
in core Node.js,false
inexeca
. Unchanged. We should add a property similar toerror.timedOut
but formaxBuffer
instead. I can do it in a separate PR.Note: this not does change
childProcess.killed
, which is a separate property and istrue
whenchildProcess()
was successfully called (in both core Node.js andexeca
).