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

[BUG] Add --nodigest and --nosignature flags to rpm call in yumpkg module #65152

Closed
bdrx312 opened this issue Sep 7, 2023 · 4 comments · Fixed by #65172
Closed

[BUG] Add --nodigest and --nosignature flags to rpm call in yumpkg module #65152

bdrx312 opened this issue Sep 7, 2023 · 4 comments · Fixed by #65172
Assignees
Labels
Bug broken, incorrect, or confusing behavior Performance

Comments

@bdrx312
Copy link
Contributor

bdrx312 commented Sep 7, 2023

Is your feature request related to a problem? Please describe.

yumpkg list_pkgs makes a subprocess command call to rpm -qa to list the packages (

salt/salt/modules/yumpkg.py

Lines 747 to 752 in caa5e39

cmd = [
"rpm",
"-qa",
"--queryformat",
salt.utils.pkg.rpm.QUERYFORMAT.replace("%{REPOID}", "(none)") + "\n",
]
). rpm -qa does digest and signature checking by default. list_pkgs is does not need to verify checksums and signatures and therefore can reduce the time to list the packages by disabling the digest and signature checking with the --nodigest and --nosignature flags.

Describe the solution you'd like
Add the --nodigest and --nosignature to the cmd variable that is passed to cmd.run in the list_pkgs function of salt/modules/yumpkg.py

Additional context

Here are a couple of example timings of rpm -qa before and adding the flags on my rhel 8 ec2 instance:

$ free && sync && echo 3 > /proc/sys/vm/drop_caches && free
$ time rpm -qa > /dev/null

real: 0m2.944s
user: 0m1.689s
sys:  0m0.163s
$ time rpm -qa > /dev/null

real: 0m1.740s
user: 0m1.644s
sys:  0m0.079s
$ free && sync && echo 3 > /proc/sys/vm/drop_caches && free
$ time rpm -qa --nodigest --nosignature > /dev/null

real: 0m1.319s
user: 0m0.259s
sys:  0m0.147s
$ time rpm -qa --nodigest --nosignature > /dev/null

real: 0m0.366s
user: 0m0.235s
sys:  0m0.099s
@bdrx312 bdrx312 added Feature new functionality including changes to functionality and code refactors, etc. needs-triage labels Sep 7, 2023
@whytewolf
Copy link
Collaborator

@bdrx312 I know you were working on a PR were you able to get that started?

@bdrx312
Copy link
Contributor Author

bdrx312 commented Sep 11, 2023

@bdrx312 I know you were working on a PR were you able to get that started?

No I have been busy and haven't had time to figure out how to setup a saltstack development environment on Windows with vagrant yet. I created a fork and committed the change. If someone wants take the changes and pick up from there they can see it here https://github.com/bdrx312/salt. I am not sure when I will have time.

@whytewolf whytewolf self-assigned this Sep 11, 2023
@whytewolf whytewolf added Bug broken, incorrect, or confusing behavior and removed Feature new functionality including changes to functionality and code refactors, etc. labels Sep 11, 2023
@whytewolf whytewolf added this to the Sulfur v3006.4 milestone Sep 11, 2023
@whytewolf
Copy link
Collaborator

moving this to bug as the speed up is enough that this could be considered a bug in speed.

@whytewolf whytewolf changed the title [FEATURE REQUEST] Add --nodigest and --nosignature flags to rpm call in yumpkg module [BUG] Add --nodigest and --nosignature flags to rpm call in yumpkg module Sep 11, 2023
@Ch3LL
Copy link
Contributor

Ch3LL commented Sep 13, 2023

Closed by #65172

@Ch3LL Ch3LL closed this as completed Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants