mirror of https://github.com/hashicorp/consul
Browse Source
memdb's `WatchCh` method creates a goroutine that will publish to the returned channel when the watchset is triggered or the given context is canceled. Although this is called out in its godoc comment, it's not obvious that this method creates a goroutine who's lifecycle you need to manage. In the xDS capacity controller, we were calling `WatchCh` on each iteration of the control loop, meaning the number of goroutines would grow on each autopilot event until there was catalog churn. In the catalog config source, we were calling `WatchCh` with the background context, meaning that the goroutine would keep running after the sync loop had terminated.pull/14972/head
Dan Upton
2 years ago
committed by
GitHub
3 changed files with 16 additions and 6 deletions
@ -0,0 +1,3 @@ |
|||||||
|
```release-note:bug |
||||||
|
server: fix goroutine/memory leaks in the xDS subsystem (these were present regardless of whether or not xDS was in-use) |
||||||
|
``` |
Loading…
Reference in new issue