Skip to content

Commit bb406ee

Browse files
committed
fix: pkg/hwapi: close fd on each iteration in ReadMSR
Since the contents of MSRs is stored in ret anyways, we can make a syscall to close a MSRs' fd, otherwise we are likely to hit the limit of open files per process (i.e. 'ReadMSR - gomsr.MSR context aborted with: too many open files'). Signed-off-by: Michal Gorlas <michal.gorlas@9elements.com>
1 parent df32f36 commit bb406ee

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/hwapi/msr.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func (h HwAPI) ReadMSR(msr int64) []uint64 {
2323
break
2424
}
2525
ret = append(ret, msrData)
26+
msrCtx.Close()
2627
count++
2728
}
2829

0 commit comments

Comments
 (0)