panjf2000 / ants

🐜🐜🐜 ants is the most powerful and reliable pooling solution for Go.
https://ants.andypan.me/
MIT License
12.83k stars 1.36k forks source link

fix: exit ticktock goroutine when pool is closed #264

Closed GlebRadchenko closed 1 year ago

GlebRadchenko commented 1 year ago

name: Pull request about: Fixes a bug title: 'fix ticktock memory leaks' labels: '' assignees: ''

1. Are you opening this pull request for bug-fixs, optimizations or new feature?

bugfix

2. Please describe how these code changes achieve your intention.

The fix enables ticktock goroutine to stop it's execution.

3. Please link to the relevant issues (if any).

https://github.com/panjf2000/ants/issues/263

4. Which documentation changes (if any) need to be made/updated because of this PR?

-

4. Checklist

codecov[bot] commented 1 year ago

Codecov Report

Base: 92.88% // Head: 93.17% // Increases project coverage by +0.28% :tada:

Coverage data is based on head (42086fe) compared to base (3fbd956). Patch coverage: 97.14% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #264 +/- ## ========================================== + Coverage 92.88% 93.17% +0.28% ========================================== Files 9 9 Lines 759 791 +32 ========================================== + Hits 705 737 +32 Misses 41 41 Partials 13 13 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `93.17% <97.14%> (+0.28%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andy+Pan#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/panjf2000/ants/pull/264?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andy+Pan) | Coverage Δ | | |---|---|---| | [pool.go](https://codecov.io/gh/panjf2000/ants/pull/264/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andy+Pan#diff-cG9vbC5nbw==) | `90.49% <97.14%> (+0.67%)` | :arrow_up: | | [pool\_func.go](https://codecov.io/gh/panjf2000/ants/pull/264/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andy+Pan#diff-cG9vbF9mdW5jLmdv) | `91.88% <97.14%> (+0.50%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andy+Pan). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andy+Pan)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.