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

fix: fix ethtool issue when trying to skip unsupported interface #1296

Merged
merged 12 commits into from
Feb 12, 2025

Conversation

xiaozhiche320
Copy link
Contributor

@xiaozhiche320 xiaozhiche320 commented Jan 31, 2025

Description

This PR addresses an issue where the plugin repeatedly logged the same operation not supported error for interfaces on every metrics collection cycle. The root cause ethtool handle is created and closed during each interval, which invalidated any cached (LRU) information on unsupported interfaces. Now, once an interface is identified as unsupported, it won’t repeatedly log the same error.

Related Issue

If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request.

#1280

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • I have updated the documentation, if necessary.
  • I have added tests, if applicable.

Screenshots (if applicable) or Testing Completed

Please add any relevant screenshots or GIFs to showcase the changes made.

Logs before fixing the issue:
Before
Logs after fixing the issue, the unsupported cache will only log once now (add debug message for test and validate behaviour of LRU, which has been removed in PR):
After

Additional Notes

Add any additional notes or context about the pull request here.


Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.

@xiaozhiche320 xiaozhiche320 requested a review from a team as a code owner January 31, 2025 14:13
pkg/plugin/linuxutil/linuxutil_linux.go Outdated Show resolved Hide resolved
pkg/plugin/linuxutil/ethtool_stats_linux.go Outdated Show resolved Hide resolved
pkg/plugin/linuxutil/ethtool_handle_linux.go Outdated Show resolved Hide resolved
@xiaozhiche320 xiaozhiche320 self-assigned this Jan 31, 2025
SRodi
SRodi previously approved these changes Feb 4, 2025
Copy link
Member

@SRodi SRodi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, pending @ritwikranjan re-review.

@xiaozhiche320 xiaozhiche320 requested a review from SRodi February 12, 2025 12:13
pkg/plugin/linuxutil/linuxutil_linux.go Outdated Show resolved Hide resolved
pkg/plugin/linuxutil/ethtool_stats_linux.go Show resolved Hide resolved
pkg/plugin/linuxutil/ethtool_stats_linux.go Outdated Show resolved Hide resolved
pkg/plugin/linuxutil/linuxutil_linux.go Outdated Show resolved Hide resolved
pkg/plugin/linuxutil/linuxutil_linux.go Outdated Show resolved Hide resolved
@xiaozhiche320 xiaozhiche320 added this pull request to the merge queue Feb 12, 2025
Merged via the queue into microsoft:main with commit 65b6244 Feb 12, 2025
28 checks passed
@xiaozhiche320 xiaozhiche320 deleted the fix_ethtool branch February 12, 2025 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants