eleventy: Ctrl+C doesn't exit completely when running --watch in parallel with something else
Operating system
Linux Pop! OS 24.04
Eleventy
3.1.0
Describe the bug
Killing eleventy --watch with Ctrl-C when it is running in parallel with something else does not entirely kill the process. I guess…
In my experience, this leads to strange consequences in dev like ‘half-baked’ builds or the dev server not serving the files… I really pulled my hair more than once on incomprehensible bugs and more than once it was because of this unexpected bug (?).
I know we are getting into the supernatural with this next sentence but… I feel like, sometimes, even killing Node is not enough and I need a full reboot to get my project back on track. Like if there was some conflicting code running into the ether or some stubborn bit not wanting to change state… 😅
Reproduction steps
- Run 11ty in parallel with something.
npx @11ty/eleventy --watch & ping www.11ty.dev
- Kill the process with
Ctrl+C. - Kill all node processes (or any fancier way to check running processes)
killall node
It outputs something like…
Terminated
[1]+ Exit 143 npx @11ty/eleventy --watch
Note that running the scripts with something like concurrently yields the same result.
Expected behavior
Ctrl-C should properly kill the watch process and cleanup resources it was using.
Reproduction URL
No response
Screenshots
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (12 by maintainers)
Try this one:
If you CTRL+C it will only stop the second ping command, the first will continue until the 10 pings have completed.
@zachleat Thanks a lot for your patience and educational posts. 🙂
Definitely some interesting stuff in there. I’ll try and play around with these. Thanks.
Fair enough about
&. So my minimal repro is not actually a repro of the real issue. I triedconcurrentlyin the repro and it works as expected, closing both processes with CTRL-C.BUT my real world project still falls apart in strange ways sometimes. I haven’t been able to reproduce the issue in a systematic way yet… Very frustrating. I’ll continue monitoring and try and figure out what combination of factors might be causing the issue…