From 6dc9fe450c5b8d5ce6e3810c3bdf8933394167b5 Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Fri, 5 Mar 2021 13:39:04 +0100 Subject: [PATCH] Cleanup portforward streams after their usage This implements a stream cleanup when using portforwardings. Before applying this patch, the streams []httpstream.Stream within `spdy/connection.go` would fill-up for each streaming request. This could result in heavy memory usage. Now we use the stream identifier to keep track of them and finally remove them again once they're no longer needed. Signed-off-by: Sascha Grunert Kubernetes-commit: a1ee076d5f4a3965afe43d0bc23096dfdc170448 --- tools/portforward/portforward_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/portforward/portforward_test.go b/tools/portforward/portforward_test.go index 5b9afabea..034be748f 100644 --- a/tools/portforward/portforward_test.go +++ b/tools/portforward/portforward_test.go @@ -68,6 +68,9 @@ func (c *fakeConnection) CloseChan() <-chan bool { return c.closeChan } +func (c *fakeConnection) RemoveStreams(_ ...httpstream.Stream) { +} + func (c *fakeConnection) SetIdleTimeout(timeout time.Duration) { // no-op }