[omnibus] Patch psutil to fix automount logs in Docker container with disk check #12604
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 does this PR do?
Adds an omnibus patch to
psutil
to fix an issue with that started with the5.7.4
release ofpsutil
.Motivation
In Agent 7.35.0, we upgraded the embedded
psutil
version from5.7.2
to5.9.0
. One of the changes this brought is giampaolo/psutil#1863, which modifiedpsutil.disk_partitions
to also collect themaxpath
andmaxfile
fields.This new feature has two negative effects:
psutil.disk_partitions
(mentioned in Allow to avoid expensive statfs call in disk_partitions. giampaolo/psutil#2110)automount
is enabled, if you run the Docker Agent with the disk check enabled and/proc
mounted in the container (which is what we document in our install docs), theautomount
ofbinfmt_misc
is repeatedly called, causing a huge amount of noise in/var/log/syslog
(during each check run):This PR patches
psutil
to remove themaxpath
andmaxfile
fetch feature, which we don't use in the check.Once giampaolo/psutil#2110 is merged and released, we can remove this patch, update
psutil
and add theget_maxfile_maxpath=False
option to the disk check'spsutil.disk_partitions
calls.Additional Notes
The issue can be reproduced by rebooting the host, then running:
on an Ubuntu system (I tried with 18.04).
The fix can be tested by rebooting the host again, then running:
Possible Drawbacks / Trade-offs
n/a
Describe how to test/QA your changes
Run the setup described in the additional notes, check that the issue happens with
7.35.0
~7.37.1
but not with this PR, and that the disk check works as expected.Reviewer's Checklist
Triage
milestone is set.major_change
label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.changelog/no-changelog
label has been applied.qa/skip-qa
label is not applied.team/..
label has been applied, indicating the team(s) that should QA this change.need-change/operator
andneed-change/helm
labels have been applied.