-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Cannot terminate whilst running imported function #45278
Comments
@nodejs/modules |
Does this happen without TLA, or without ESM, or does it require all of these conditions? |
I would have to set up some testing for that if it's really important |
Narrowing down how broad the scope is seems important :-) that would be appreciated! |
Okay will do! |
I am failing to replicate this issue in a different folder. It might take some time for me to narrow down the issue |
I have not managed to narrow it down and am unable to repoduce it. If anyone wants to give it a shot be my guest but at this point i'm unsure if it has to do with NodeJS or a weird TypeScript error. |
Closing as unreproducible, if you have a minimum reproduction please comment and we can reopen. |
Here's a minimal reproduction that can't be terminated with process.on('SIGINT', () => process.exit(0));
while (true); but these programs can be terminated: while (true); process.on('SIGINT', () => process.exit(0));
setTimeout(() => { }, 10_000); inquirer used in @MauritsWilke's AdventOfCode example also set up a sigint handler. Seems to be a duplicate issue: #9050 For anyone else who stumbles across this issue and wants a workaround: create a child process, worker_thread or fork that runs the sync/loop code. It can be terminated by the main process at any time. |
Version
v18.10.0
Platform
Linux Dennis 5.15.74-3-MANJARO #1 SMP PREEMPT Sat Oct 15 13:39:11 UTC 2022 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
index.js
file that has an async functionawait import()
while(true)
loopindex.js
and try terminating whilst thewhile(true)
loop is running (using ctrl+c)Or use the repo where this occurs:
https://github.com/MauritsWilke/AdventOfCode
22
undersrc/2015
and put in apart1.ts
with the following code:tsc
to compile (if it doesn´t happen automatically in VSC)node .
and use the arrow keys to select the year2015
, the day22
and the part1
How often does it reproduce? Is there a required condition?
Every single time I run it on both the given platform and a windows platform
What is the expected behavior?
I expect
ctrl+c
to terminate the program.What do you see instead?
Well nothing because it aint terminating :)
Additional information
No response
The text was updated successfully, but these errors were encountered: