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

Potential leak in sleep.go #1474

Closed
hhheiaenia opened this issue May 28, 2023 · 1 comment · Fixed by #1475
Closed

Potential leak in sleep.go #1474

hhheiaenia opened this issue May 28, 2023 · 1 comment · Fixed by #1475

Comments

@hhheiaenia
Copy link

I notice the ctx.Done() needs a cancel function to unblock the statement of ctx.Done in https://github.com/shirou/gopsutil/blob/master/internal/common/sleep.go#LL13C1-L13C1,
but I never find the cancel function in its invocation. So if this may leak the goroutine where the ctx.Done() locates?

Maybe what I said is not right, thank you.

@shirou
Copy link
Owner

shirou commented May 28, 2023

After some searching, I thought your point was correct. Thank you for the suggestion, and I have opened a PR for fix it, #1475. Could you check it out? Thank you!

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 a pull request may close this issue.

2 participants