Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make UnregisterSet() less error-prone to use
Previously it was expected that the user calls s.UnregisterAllMetrics() after calling UnregisterSet(s). This led to many subtle memory leak bugs like VictoriaMetrics/VictoriaMetrics#6247 . Solve this issue by adding `destroySet bool` arg to UnregisterSet(), so it automatically calls s.UnregisterAllMetrics() if destroySet=true. This changes UnregisterSet() function signature, so users need to update UnregisterSet() calls across their code bases after upgrading to the new version of github.com/VictoriaMetrics/metrics package. This is OK, since this allows fixing subtle memory leak bugs like VictoriaMetrics/VictoriaMetrics#6247 .
- Loading branch information