Commit 532b01f
[release-1.22] Fix goroutine/memory leak in SubjectAndFiltersPass (#9152)
Fix goroutine/memory leak in SubjectAndFiltersPass
SubjectAndFiltersPass created filter objects via
CreateSubscriptionsAPIFilters on every request but never called
Cleanup() on them. The anyFilter and allFilter types each spawn a
background goroutine (optimizeLoop) that only terminates when
Cleanup() is called, causing goroutines, channels, and filter
objects to leak on every event dispatch.
Under sustained error traffic (e.g. dispatching to non-existing
sinks), this accumulated millions of leaked goroutines and
eventually caused the imc-dispatcher to OOM crash.
Co-authored-by: Christoph Stäbler <cstabler@redhat.com>1 parent 9c09ed6 commit 532b01f
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
231 | 233 | | |
232 | 234 | | |
233 | 235 | | |
| |||
0 commit comments