[GODRIVER-508] topology.Server.update leaks time.Tickers Created: 25/Jul/18 Updated: 28/Oct/23 Resolved: 26/Jul/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Server Discovery and Monitoring |
| Affects Version/s: | 0.0.9 |
| Fix Version/s: | 0.0.10 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Rikard Anglerud | Assignee: | Kristofer Brandow (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
The update method sets up two tickers, but does not stop them. This causes a memory leak. Found while implementing a prometheus blackbox-style probe. I've got a small patch I'll send as a github PR. Below is my probe running without it for a few hours, then with it.
|
| Comments |
| Comment by Kristofer Brandow (Inactive) [ 26/Jul/18 ] |
|
Thanks again for the bug report and the pull request! |
| Comment by Githook User [ 26/Jul/18 ] |
|
Author: {'name': 'Rikard Anglerud', 'email': 'Rikard.Anglerud@man.com'}Message: This should fix a memory leak in topology.Server's update() |
| Comment by Rikard Anglerud [ 25/Jul/18 ] |
|
Thank you - I've submitted https://github.com/mongodb/mongo-go-driver/pull/78 |
| Comment by Kristofer Brandow (Inactive) [ 25/Jul/18 ] |
|
Okay, great. I'll keep an eye out for the pull request. |
| Comment by Rikard Anglerud [ 25/Jul/18 ] |
|
Those are the ones, yep. |
| Comment by Kristofer Brandow (Inactive) [ 25/Jul/18 ] |
|
Hi ranglerud, Thanks for the bug report. Are these the timers you are referring to? --Kris |