agent
agent copied to clipboard
Fix memory leak in loki.process on config update
PR Description
A goroutine wasn't being stopped in Update, which resulted in a memory leak.
The same change was also introduced to Alloy.
PR Checklist
- [x] CHANGELOG.md updated
- [ ] Documentation added
- [x] Tests updated
- [ ] Config converters updated
Hi @thampiotr, would you mind reviewing the latest commit please? The unit tests kept being flaky, and I realised it's because the loki.process code needs to be improved further to shut down more gracefully. If you're happy with this change, I'll also open a PR for Alloy to have it.