-
Notifications
You must be signed in to change notification settings - Fork 881
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
Ubuntu/devel #4472
Ubuntu/devel #4472
Conversation
cc_apt_configure will use apt_pkg from this deb if present to read apt configuration for Dir::Etc::sourceparts/sourcelist values. When absent, rely on the command apt-config dump.
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.
@blackboxsw What value is added by this dependency? Looking at the code it looks like both the apt_pkg
and the apt-config dump
codepaths do the same thing - is that correct?
The PR discussion, commit message, and code comments don't explain why this was added either. If we can accomplish the same thing without a extra dependency, why wouldn't we just always do that? Maintaining multiple codepaths that do the same thing adds maintenance cost - what do we/users get in exchange for this cost? Edit: Sorry this feedback didn't get into the initial review. This PR looks fine, but I would like at a minimum to see an explanation for the tradeoffs made here documented for future developers - describing the tradeoffs being made here in comments in the code would be fine. And if the functionality really is the same (outside of "library vs subp call"), then I don't think that I agree that we should go forward with making this Recommends, and in that case I would also prefer if we drop the alternative code path from our code. |
Performance-wise, tradeoff is about 7ms on the critical-chain, though not on the "time to ssh" path. Adding it as Recommends isn't going to bloat anything. The library already exists in our minimal images. Is an extra 5 lines of code (plus tests) worth 7ms? |
Nice. Did I miss this in a comment in the PR?
Agreed, package bloat was not my concern for a Recommends dependency.
@TheRealFalcon I'm not opposed to keeping it if there is a performance benefit. Let's just please document the tradeoffs being made in this code while the reasons are fresh. Looking at the fallback code just makes me ask "but why?", because tradeoffs are clearly being made but not explained by the code or commit message. The intent is non-obvious, so it deserves a little context in an easy-to-find place (preferably right in the code as a comment). I didn't know performance was the reason for this until your comment (and think I read all of the comments in the original PR), and shelling out vs a library that reads files from disk isn't an obvious performance benefit - synchronous reads from disk are required for both of these code paths. |
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.
I'm ok with this as-is, but I agree with Brett that we should document why this is ok.
v
I've added documentation about the performance tradeoff and Recommends: state of python3-apt vs subp in PR #4484 |
do not squash merge
Queue Recommends dependency on python3-apt for apt_pkg module since cc_apt_configure uses it for some operations.
Cloud-init falls back to
apt-config dump
command when python module not present.When this PR is merged, I will reflect it to Focal/Jammy/Lunar branches
Proposed commit messages
Additional Context
Test Steps
Checklist: