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(pool,ww): unstopped ticker causes a memory leak #870

Merged
merged 5 commits into from
Dec 14, 2021

Conversation

rustatian
Copy link
Member

@rustatian rustatian commented Dec 14, 2021

Reason for This PR

  • A lot of allocated memory when supervised pool with often workers restarts used.

Description of Changes

  • Stop the ticker on the pool's destroy call.
  • Properly lock-unlock the destroy mutex in the worker_watcher
  • Supervisor is now synchronized with the check workers loop (which actually checks the memory, ttl, etc).

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.

PR Checklist

[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]

  • All commits in this PR are signed (git commit -s).
  • The reason for this PR is clearly provided (issue no. or explanation).
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • Any user-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.

supervised pool ticket stop

Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
@rustatian rustatian added B-bug Bug: bug, exception B-performance Bug: performance issues labels Dec 14, 2021
@rustatian rustatian requested a review from wolfy-j December 14, 2021 08:13
@rustatian rustatian self-assigned this Dec 14, 2021
@rustatian rustatian changed the title bug(pool,ww): unstopped ticker cause memory leak bug(pool,ww): unstopped ticker cause a memory leak Dec 14, 2021
@rustatian rustatian added this to the v2.6.1 milestone Dec 14, 2021
@codecov
Copy link

codecov bot commented Dec 14, 2021

Codecov Report

Merging #870 (8c789be) into master (53beef1) will increase coverage by 0.77%.
The diff coverage is 70.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #870      +/-   ##
==========================================
+ Coverage   80.72%   81.49%   +0.77%     
==========================================
  Files          19       19              
  Lines        1608     1616       +8     
==========================================
+ Hits         1298     1317      +19     
+ Misses        260      248      -12     
- Partials       50       51       +1     
Impacted Files Coverage Δ
worker/sync_worker.go 79.12% <40.00%> (+0.51%) ⬆️
worker_watcher/worker_watcher.go 82.91% <80.00%> (+1.98%) ⬆️
pool/supervisor_pool.go 92.19% <100.00%> (+2.72%) ⬆️
worker/state.go 78.94% <0.00%> (-5.27%) ⬇️
worker/worker.go 91.30% <0.00%> (+2.60%) ⬆️
events/events.go 84.61% <0.00%> (+7.69%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e273e2b...8c789be. Read the comment docs.

@rustatian rustatian changed the title bug(pool,ww): unstopped ticker cause a memory leak bug(pool,ww): unstopped ticker causes a memory leak Dec 14, 2021
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
@rustatian rustatian merged commit f2c7901 into master Dec 14, 2021
@bors bors bot deleted the bug/supervisor-pool-timer-leak branch December 14, 2021 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-bug Bug: bug, exception B-performance Bug: performance issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant