Skip to content
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

Unexpected blast radius of CTRL+C when running on Windows #625

Open
RobertHenry6bev opened this issue Aug 21, 2023 · 1 comment
Open

Unexpected blast radius of CTRL+C when running on Windows #625

RobertHenry6bev opened this issue Aug 21, 2023 · 1 comment

Comments

@RobertHenry6bev
Copy link
Contributor

I have a power shell script which Start-Process $N independent cranks which will, in turn, start up independent copies of the techempower webserver app. The powershell script finally runs a python program which doesn't intentionally exit, so the powershell script itself doesn't exit. Loads are presented and serviced.

Something causes crank to "Sending CTRL+C" which has the unfortunate side effect of killing off my python program, and ALL of the other running crank instances as well. It seems you are calling GenerateConsoleCtrlEvent(CtrlTypes.CTRL_C_EVENT ...) which I infer goes rather broadly and kills my python program. Why is the CTRL+C being sent? Why so broadly?

I am Start-Process my independent cranks with the "-NoNewWindow" argument, hoping (following Linux) that would run all of the cranks in parallel, all sharing stdout and stderr, and, indeed that is the case. But CTRL+C is sent, apparently, to all tasks sharing the same window.

I can avoid this issue by Start-Process without the -NoNewWindow; I end up with one window per crank, and the blast radius of CTRL+C is appropriately limited. But what do I do when I want to launch all of this from within a ssh session, or I do not have access to video?

@sebastienros
Copy link
Member

Is it still happening? I pushed some changes on this code as I was seeing the same issues with some runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants