broccolijs / broccoli-cli

Command line interface for Broccoli
MIT License
57 stars 12 forks source link

Ctrl + C takes a very long time #3

Open Globegitter opened 10 years ago

Globegitter commented 10 years ago

After running broccoli serve and hitting Ctrl + C to stop the command it takes ~30 seconds until the command actually finished and the shell is responsive again.

All I did was cloning the sample app and running broccoli serve on that as-is.

rwjblue commented 10 years ago

This is because most of the operations are synchronous I believe.

rwjblue commented 10 years ago

Which means that the process exit handlers have to wait until the main thread is unlocked to run the cleanup task.

Globegitter commented 10 years ago

Ah ok, so this means that at least for the time being there is no simple workaround?

rwjblue commented 10 years ago

Correct, but I do think a fix is possible, just not a quick-fix.

joliss commented 9 years ago

When I hit Ctrl+C during a build (either build or serve) with current Broccoli on iojs 1.5 on Linux, it exits immediately. However it doesn't clean up tmp directories. I'd like to revisit the tmp cleanup logic when the upcoming API change is done, as it centralizes the tmp dir handling.

Getting back to the issue at hand, do you still see the "delayed exit" behavior on Mac? I actually don't remember ever seeing this problem myself, so perhaps it's platform-specific.

stefanpenner commented 6 years ago

mid-build cancellation PR https://github.com/broccolijs/broccoli/pull/350 (forward port from ember-cli's fork) should address this.

kylecordes commented 6 years ago

This continues to be a surprising behavior, and something to talk around when introducing Broccoli to a new developer. Other build tool CLIs exit promptly on control-C... it would be ideal to catch up with the mainstream on this!