-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Bugfix: adjust incorrectly passed keywords with exclude-strings argument #15721
base: devel
Are you sure you want to change the base?
Bugfix: adjust incorrectly passed keywords with exclude-strings argument #15721
Conversation
Thanks for figuring this out. Offering some quick confirmation of the basic idea here:
Removing all 3 directories is unintended here, because they were passed in the
Out of the 3 folders, this commands removes 2 of this, which is intended. It should still delete the folder not in the My only very minor comment / request-for-change would be from looking at your test output:
IMO, a better standard pattern would be to retain the quotes, but for each arg. Getting rid of the
This still gives us the desired behavior of deleting the 4321 directory. But for all arguments, we ditch the Consequence of bugThe cleanup job needs to use the As you mention "JSON error", I want to talk this out that we're talking about errors in jobs that just happen to be running at the same time the cleanup command runs, because of disruptions from their private_data_dir being deleted. That is generally what I would expect from this. |
I am looking to contribute test content for this fix in #15722 I did test it with your patch and it fixes it 🎉 You're fine to fix up your very small diff here and get it merged, and I can merge the tests after a rebase. |
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.
Changes needed to merge this:
- Modify code to quote items in
option
individually - Update
test_image_cleanup_scenario
test to remove=
from the expectation - From the PR template, edit your PR title to identify it as a bug fix (I can do this)
Thank you for your quick review. You're right, we need to keep those quotes - sorry for overlooking that. |
…unner worker cleanup command Signed-off-by: Sasa Jovicic <[email protected]>
acdea01
to
aca056c
Compare
Quality Gate passedIssues Measures |
started CI, waiting on @AlanCoding to clear his change requested. might be a bit for this one to land @Sasa993 since most of us are going into the US holiday season/shutdown but great stuff. |
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.
Merge order comments:
- this looks set to go in as-is, then Tests for exclude list with multiple jobs #15722 will rebase and merge
- as @thedoubl3j mentions, slight delay until after holiday
SUMMARY
This PR addresses an issue with how the
--exclude-strings
argument is passed toansible-runner
during the cleanup task.Issue
When
--exclude-strings
is passed with quotes, such as:--exclude-strings="awx_1, awx_2"
--exclude-strings="awx_1 awx_2"
The argument is treated as a single string, and
ansible-runner
receives it as:["awx_1 awx_2"]
or["awx_1, awx_2"]
.This causes the exclusion logic to fail and as a result, directories or files specified in
--exclude-strings
are not excluded from cleanup.Impact
Due to this bug, the
ansible-runner worker cleanup
command removes directories and files that are intended to be excluded by the--exclude-strings
argument.In our case, this bug results in running jobs being killed by the cleanup task triggered by another job on the same execution node.
I suspect this issue may have contributed to the "JSON error" problems that have been frequently reported. (like 14693, 15657, 15122)
Expected Behavior:
When
--exclude-strings
is passed without quotes and the=
sign, like:--exclude-strings awx_1 awx_2
,ansible-runner
correctly parses it into a list of separate strings:["awx_1", "awx_2"]
.This allows the cleanup process to properly exclude the specified directories or files.
ISSUE TYPE
COMPONENT NAME
AWX VERSION
ADDITIONAL INFORMATION