generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 35
feat: more robust Linux cross-user cancelation under low memory conditions #479
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
Merged
jusiskin
merged 1 commit into
aws-deadline:mainline
from
jusiskin:linux_direct_signals_cap_kill
Nov 26, 2024
Merged
feat: more robust Linux cross-user cancelation under low memory conditions #479
jusiskin
merged 1 commit into
aws-deadline:mainline
from
jusiskin:linux_direct_signals_cap_kill
Nov 26, 2024
Conversation
This file contains hidden or 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
d9cb534 to
04a236e
Compare
ddneilson
suggested changes
Nov 22, 2024
Contributor
|
Oh, also, the README should probably be updated to list the (optional) dependency on |
04a236e to
beb0ff7
Compare
Signed-off-by: Josh Usiskin <[email protected]>
beb0ff7 to
cdd677e
Compare
|
AWS-Samuel
approved these changes
Nov 26, 2024
ddneilson
approved these changes
Nov 26, 2024
Contributor
ddneilson
left a comment
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.
Thanks for taking this on, Josh. Looks great!
Merged
This was referenced Feb 5, 2025
This was referenced May 21, 2025
This was referenced Jun 24, 2025
Closed
Closed
This was referenced Jun 24, 2025
Closed
Merged
This was referenced Jul 23, 2025
Merged
Merged
This was referenced Oct 23, 2025
Closed
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.



What was the problem/requirement? (What/Why)
Under low memory situations on Linux, the worker agent can fail to cancel a running session action.
On Linux, processes can only send signals to other processes if at least one of the following are true:
rootCAP_KILLcapability (seecapabilities(7) man page)To overcome this limitation,
openjd-sessionsusedsudoto create abashprocess as the target user which then sends the OS signal. When the system has low memory, there may not be sufficient memory to create the subprocesses successfully.What was the solution? (How)
OpenJobDescription/openjd-sessions-for-python#196 is a work-in-progress enhancement to leverage
CAP_KILLand send signals to cross-user processes without creating subprocesses.This PR builds on this support for
CAP_KILLso the worker agent directly signals cross-user processes.install-deadline-workerwas modified to configure the worker agent systemd unit with theCAP_KILLambient capability. This has the effect of addingCAP_KILLto the worker agent process' permitted/effective/inheritable capability sets.CAP_KILLfrom the inheritable capability set early in the program startup so that other threads and subprocesses will not inherit this privileged capability.openjd-sessionchange takes care of the rest and handles direct signalling for cross-user processes.What is the impact of this change?
This change allows the worker agent to cancel session actions more robustly in low-memory situations.
How was this change tested?
The cross-user direct signal cancelation tests live in
openjd-sessions, but a security end-to-end test was added to ensure that session actions are not able to signal other processes.Was this change documented?
No
Is this a breaking change?
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.