-
-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isTerminated
false after kill()
#1177
Comments
Hi @mifi,
When you do Instead, you call |
Hi. In my real world use case it's ffmpeg that returns a non-zero exit code when receiving a SIGTERM, causing this scenario, so I cannot control how it exits. I'm not sure how I can determine in my
|
If a subprocess is terminated with a signal like If not, but if There are also a few other reasons why a subprocess might fail, documented here. |
I did another test with cancelSignal: // test.js
// test.js
import { execaNode } from 'execa'
const abortController = new AbortController()
const subprocess = execaNode('subprocess.js', { cancelSignal: abortController.signal });
setTimeout(() => {
abortController.abort()
}, 2000)
await subprocess.catch((err) => console.log('err', err));
console.log('done'); am now getting:
|
This is expected as well. 👍 |
execa@npm:9.5.1
Looking at the docs it seems to me that when calling
subprocess.kill
execa should setisTerminated: true
on the result. However I've found a case where this does not happen:When test.js is run it logs this:
Not sure if this is a bug or expected behaviour. If it's expeced, should we update the docs to make it more clear? And how would you know I the process was killed in this case when catching the error?
Note: this is not related to execaNode, it happens for me with execa too (but I coudln't find a way to reproduce).
The text was updated successfully, but these errors were encountered: