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

command: fix signalling to command process group #637

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

adambabik
Copy link
Collaborator

@adambabik adambabik commented Jul 24, 2024

This change also fixes a regression that broken running interactive commands, like runme in runme, run from the CLI in da2c38c.

It also disables FIFO which should mitigate #635 but a proper fix is needed.

Relates to #636

@adambabik
Copy link
Collaborator Author

@sourishkrout I was able to reproduce the issue and verify this fix using grpcurl.

@adambabik adambabik marked this pull request as draft July 24, 2024 20:53
@adambabik
Copy link
Collaborator Author

@sourishkrout there is a genuine problem with TestRunnerServiceServerExecute_WithStop so getting this PR back to draft.

I dug into this and when doing CTRL-C in the terminal, you actually send a SIGINT to the whole process group (a great thread that explains it thoroughly). Now I remember why I implemented this :) However, when running a server and executing commands by it, the server and the commands share the same process group and we kill the server when we send a signal to the process group; the effect is the reported bug.

It seems like the ideal solution is to make the command its own process group, just as it is done by bash. I will try that. In fact, there is code doing that but it's not used in v2.

@sourishkrout
Copy link
Member

I dug into this and when doing CTRL-C in the terminal, you actually send a SIGINT to the whole process group (a great thread that explains it thoroughly). Now I remember why I implemented this :) However, when running a server and executing commands by it, the server and the commands share the same process group and we kill the server when we send a signal to the process group; the effect is the reported bug.

That explains why the kernel server suddenly dies 😆.

@adambabik adambabik force-pushed the adamb/command/disable-process-group-signal branch from a5dca03 to d92bd59 Compare July 27, 2024 18:10
This fixes interactive commands like runme-in-runme.
@adambabik adambabik force-pushed the adamb/command/disable-process-group-signal branch from 313e00a to da2c38c Compare July 27, 2024 18:32
Copy link

sonarcloud bot commented Jul 27, 2024

@adambabik adambabik marked this pull request as ready for review July 27, 2024 18:37
@adambabik adambabik changed the title command: disable sending signals to command process group command: fix signalling to command process group Jul 27, 2024
@adambabik
Copy link
Collaborator Author

@sourishkrout ready to test and review.

Copy link
Member

@sourishkrout sourishkrout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

@sourishkrout sourishkrout merged commit 19af228 into main Jul 29, 2024
7 checks passed
@sourishkrout sourishkrout deleted the adamb/command/disable-process-group-signal branch July 29, 2024 16:40
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

Successfully merging this pull request may close these issues.

2 participants