From 0f6528b1f90e08a5f86b5b039bca9b19489b26e4 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: 6459ed6717d1851f9ca28e3f245672a6a62aa0bf --- 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 c6e9e6ef..551d97e9 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 }