Fix reap_process_group sudo fallback passing the process group id as the signal number - #71671
Open
ckarnell wants to merge 1 commit into
Open
Fix reap_process_group sudo fallback passing the process group id as the signal number#71671ckarnell wants to merge 1 commit into
ckarnell wants to merge 1 commit into
Conversation
…the signal number
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
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
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.
reap_process_grouphas two sudo fallbacks forEPERM. The first passes a signal and the pids:The second, fourteen lines below, passes the process group id where the signal belongs and names no target at all:
That builds
sudo -n kill -4242, which/bin/killrejects with a usage error and exit 2, socheck_callraisesCalledProcessErrorand the process is never signalled. The path needskillpgto fail withESRCHand thenos.killwithEPERM, which is therun_as_usercase where the group has already gone but the process has not.Mocking both errnos and capturing the call:
#9202 reported this in 2020 against 1.10.9 and named
reap_process_group. It was closed without a fix. The line is unchanged.The added test fails on current main with
['sudo', '-n', 'kill', '-4242'] != ['sudo', '-n', 'kill', '-15', '4242']and passes with the change.test_process_utils.pygoes from 27 passing to 28. It mocks the signal calls, so it needs no database and carries nodb_testmarker.