-
Notifications
You must be signed in to change notification settings - Fork 142
FIX: native ipmi client not close #268
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: native ipmi client not close #268
Conversation
b4fdbde to
d4fa214
Compare
|
Additionally, regarding the issue mentioned in #243: |
bitfehler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks! Just a few minor suggestions to make this a bit less verbose:
- We now use
context.TODO()twice, which isn't great. Let's create actx := context.TODO()once and use that for both the actual work and closing the client; that makes it easier to replace this with a proper context at some point - Let's move the "close and log on error" into a function
CloseNativeClientincollector.go, so we can just calldefer CloseNativeClient(client, ctx)everywhere - Let's make the log a warning, since the sessions piling up does have real consequences
- In the log, I think it's fine to just log Client.Host as target, but if you feel strongly about it the target could also be passed in I guess
Unfortunately, #243 is sort of a collection of various unrelated issues. If you have a proposal for the sensor state issue please open a seperate PR for it, so we can discuss it better. |
d4fa214 to
9d5197e
Compare
Signed-off-by: dingxin05 <[email protected]>
9d5197e to
864ffce
Compare
Thanks for your feedback! I have resubmitted it, please review~😄 |
bitfehler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, bonus points for passing the new context to NewNativeClient() as well! 😀
Thanks a lot!
Problem Description
In issue #243, the exporter reports an error:
can't connect to ipmi collector.Additionally, when using ipmitool, there is a "BMC busy" error. After waiting for 5-10 minutes and running the command:it was observed that the number of active sessions continues to increase during the collection process. This suggests that some sessions are not being properly closed.
How to Fix
In the
ipmi-nativecode, theclientis not being closed properly. If collection continues without closing the client, it can lead to resource leaks.After using the
NewNativeClient, the client should be explicitly closed.