optimize findmnt usage to avoid JSON depth errors#631
optimize findmnt usage to avoid JSON depth errors#631boddumanohar wants to merge 1 commit intokubernetes-csi:masterfrom
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: boddumanohar The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @boddumanohar! |
|
Hi @boddumanohar. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
findmnt --jsonwithout arguments, has forced the OS to scan and return the entire mount tree of the host.On a busy Kubernetes node, this tree is extremely large and deep, causing the Go JSON decoder to hit its depth limits.
Go's JSON decoder has a default recursion limit (usually 10,000 levels).
https://github.com/golang/go/blob/master/src/encoding/json/scanner.go#L146-L148
The host's mount tree exceeded this, causing the driver to error out with that
invalid character '{' exceeded max depth messagewe saw in the logs.This PR fixes the issue by explicitly passing the
--targetparameter. So that it only returns information related to that particular volume only.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: