From a0858e29d877b8aa19478133865e45958ff21a9e Mon Sep 17 00:00:00 2001 From: Brian Marshall Date: Fri, 7 Sep 2018 15:08:53 -0600 Subject: [PATCH] Fix race in helm list when partitioning Problem: The chunks slice that is passed through the channel is reused for each partition. This means that encoding the release into a message is racing with populating the next partition, causing the results to sometimes not fit in the message, and the release list to be incorrect Solution: Allocate a new slice for each partition Issue #3322 Signed-off-by: Brian Marshall --- pkg/tiller/release_list.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tiller/release_list.go b/pkg/tiller/release_list.go index 89f7a110094..6480b96899f 100644 --- a/pkg/tiller/release_list.go +++ b/pkg/tiller/release_list.go @@ -140,7 +140,7 @@ func (s *ReleaseServer) partition(rels []*release.Release, cap int) <-chan []*re s.Log("partitioned at %d with %d releases (cap=%d)", fill, len(chunk), cap) chunks <- chunk // reset paritioning state - chunk = chunk[:0] + chunk = nil fill = 0 } chunk = append(chunk, rls)