-
Notifications
You must be signed in to change notification settings - Fork 51
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
sdexec: set KillMode=process SendSIGKILL=no for multi-user jobs #6402
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Problem: the sdexec code references 'flux imp kill' in an expanatory comment, but we plan to remove the kill subcommand from the IMP and have it forward signals to the cgroup. Drop that comment.
Problem: sdexec_start_transient_unit() does not support the SendSIGKILL attribute, which may need to be set to "off" for Flux guest jobs. Add support for the SendSIGKILL atttribute. To use, set the subprocess command option "SDEXEC_PROP_SendSIGKILL" to "off" (or other valid systemd boolean config value).
Problem: there is no test coverage that confirms sdexec can set KillMode and SendSIGKILL. Add some tests.
Problem: For multi-user jobs spawned via SDEXEC, the systemd user instance running as the flux user does not have permission to kill guest processes, yet it does try and in the process may kill off the only process that does have permission to continue cleanup efforts, the IMP. When the job is run by the IMP and sdexec, Set KillMode=process so that systemd only delivers signals to the IMP, which it should forward to the shell and/or cgroup per RFC 15. Also set SendSIGKILL to "off" so that SIGKILL is never deployed against the IMP. Fixes flux-framework#6399
grondo
approved these changes
Oct 31, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I ran a little test and did verify that the properties are set as expected when running a job a guest and when running a job as the instance owner (where the IMP is not used): As a guest:
As instance owner:
|
I'll go ahead and set MWP on this one. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem: For multi-user jobs spawned via SDEXEC, the systemd user instance running as the flux user does not have permission to kill guest processes, yet it does try and in the process may kill off the only process that does have permission to continue cleanup efforts, the IMP.
When the job is run by the IMP and sdexec, Set
KillMode=process
so that systemd only delivers signals to the IMP, which it should forward to the shell and/or cgroup per RFC 15.Also set
SendSIGKILL=off
so that SIGKILL is never deployed against the IMP.Fixes #6399
This should be OK even without the forthcoming changes to job-exec and the IMP to forward signals and avoid using SIGKILL, however I still need to give this a sanity check on my test cluster as the conditional use of these properties for IMP jobs is not tested by CI. I think we can still get a review going however so I'll not set WIP.