Skip to content

Commit

Permalink
Fix race in helm list when partitioning
Browse files Browse the repository at this point in the history
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 <bmarshall13@users.noreply.github.com>
  • Loading branch information
bmarshall13 committed Sep 7, 2018
1 parent 094b97a commit a0858e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/tiller/release_list.go
Expand Up @@ -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)
Expand Down

0 comments on commit a0858e2

Please sign in to comment.