From a52149042f70af1dc06c7a52c84708e2db2f2ec2 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: cccf49ce247c82c570b586be5438b5a7c24760d9 --- 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 }