Skip to content

Commit 660eb11

Browse files
gonzaloserranozirain
authored andcommitted
fix: memory leak (#7429)
Fix memory leak. Two watchable.Maps were never closed when shutting down the provider: - GatewayClassStatuses.Close() - missing in GatewayAPIStatuses.Close() - BackendTrafficPolicyStatuses.Close() - missing in PolicyStatuses.Close() Each unclosed map leaked 3 goroutines: 1. Internal watchable.Map.coalesce goroutine 2. HandleSubscription goroutine blocked on channel read 3. Error handler goroutine blocked on channel read Signed-off-by: Gonzalo Serrano <boikot@gmail.com> Signed-off-by: zirain <zirain2009@gmail.com>
1 parent d23a110 commit 660eb11

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/message/types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ type GatewayAPIStatuses struct {
8585
}
8686

8787
func (s *GatewayAPIStatuses) Close() {
88+
s.GatewayClassStatuses.Close()
8889
s.GatewayStatuses.Close()
8990
s.HTTPRouteStatuses.Close()
9091
s.GRPCRouteStatuses.Close()
@@ -116,6 +117,7 @@ type ExtensionStatuses struct {
116117

117118
func (p *PolicyStatuses) Close() {
118119
p.ClientTrafficPolicyStatuses.Close()
120+
p.BackendTrafficPolicyStatuses.Close()
119121
p.SecurityPolicyStatuses.Close()
120122
p.EnvoyPatchPolicyStatuses.Close()
121123
p.BackendTLSPolicyStatuses.Close()

0 commit comments

Comments
 (0)