From 322fe85e85639ca98e805c7d4f772fd60dfc5a12 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: b14bd44f33d93e1ee64c1d68fa7591d79eac5893 --- 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 c6e9e6efe..551d97e96 100644 --- a/tools/portforward/portforward_test.go +++ b/tools/portforward/portforward_test.go @@ -69,6 +69,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 }