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

[Bug]: Potential goroutine leak in pool.go #276

Closed
3 tasks done
hhheiaenia opened this issue May 28, 2023 · 3 comments
Closed
3 tasks done

[Bug]: Potential goroutine leak in pool.go #276

hhheiaenia opened this issue May 28, 2023 · 3 comments
Assignees
Labels
bug Something isn't working invalid This doesn't seem right needs investigation This issue or proposal needs some investigations waiting for response waiting for the response from commenter

Comments

@hhheiaenia
Copy link

Actions I've taken before I'm here

  • I've thoroughly read the documentations on this issue but still have no clue.
  • I've searched the current list of Github issues but didn't find any duplicate issues that have been solved.
  • I've searched the internet with this issue, but haven't found anything helpful.

What happened?

I notice the ctx.Done() needs a cancel function to unblock the statement of ctx.Done in https://github.com/panjf2000/ants/blob/dev/pool.go#LL84C21-L84C21,
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.

Major version of ants

v2

Specific version of ants

v2.6.0

Operating system

Linux

Relevant log output

.

Code snippets (optional)

.

How to Reproduce

.

Does this issue reproduce with the latest release?

I haven't verified it with the latest release

@hhheiaenia hhheiaenia added the bug Something isn't working label May 28, 2023
@panjf2000
Copy link
Owner

Check out this:

ants/pool.go

Lines 293 to 296 in 9fdd99a

if p.stopPurge != nil {
p.stopPurge()
p.stopPurge = nil
}

@panjf2000 panjf2000 added invalid This doesn't seem right waiting for response waiting for the response from commenter labels May 29, 2023
@hhheiaenia
Copy link
Author

@panjf2000 panjf2000 added the needs investigation This issue or proposal needs some investigations label Jun 6, 2023
@panjf2000
Copy link
Owner

I've read the article you provided and failed to see whatever you were seeing for memory leak, that article was talking about time.After which ants never uses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right needs investigation This issue or proposal needs some investigations waiting for response waiting for the response from commenter
Projects
None yet
Development

No branches or pull requests

2 participants