-
Notifications
You must be signed in to change notification settings - Fork 316
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
koordlet: fix cpi collector bad fd err #782
koordlet: fix cpi collector bad fd err #782
Conversation
afd3d4b
to
3104441
Compare
3104441
to
42ed20b
Compare
Codecov ReportBase: 68.16% // Head: 68.14% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #782 +/- ##
==========================================
- Coverage 68.16% 68.14% -0.03%
==========================================
Files 210 210
Lines 24084 24096 +12
==========================================
+ Hits 16418 16421 +3
- Misses 6525 6534 +9
Partials 1141 1141
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
4b5b38c
to
719be34
Compare
719be34
to
d1659d1
Compare
@songtao98 UT pipeline failed to upload to codecov, please retry.
|
d1659d1
to
dde4c8d
Compare
/lgtm |
dde4c8d
to
4fa5495
Compare
Signed-off-by: songtao98 <songtao2603060@gmail.com>
4fa5495
to
e36e573
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/milestone v1.1 |
Signed-off-by: songtao98 songtao2603060@gmail.com
Ⅰ. Describe what this PR does
This PR fixes the error occurs at koordlet CPI collector when closing container cgroup files after profiling container CPI. Related error information is shown as below:
Previously we need to get one container's cgroup directory file descriptor to call
perf_event_open()
as parampid
, thus we use structPerfCollector
to save that fd after open the cgroup path instead of saving a reference to the*os.File
it self. It turns out that with golang gc mechanism the*os.File
gets garbage collected, then the fd gets closed. But atperformance_collector_linux.go
we close that file explicitly again and that leads to the above error.A solution to the problem is to change
PerfCollector
to record the*os.File
instead of Fd int and callFile.Fd()
when you need it. For the purpose of minimum change, this PR store both of them.Ⅱ. Does this pull request fix one issue?
Ⅲ. Describe how to verify it
Ⅳ. Special notes for reviews
V. Checklist
make test