Skip to content

Commit

Permalink
kgo: avoid overflow on 32 bit systems
Browse files Browse the repository at this point in the history
  • Loading branch information
twmb committed Oct 11, 2022
1 parent db5c159 commit 719c6f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/kgo/internal/sticky/help_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package sticky

import (
"math"
"testing"

"github.com/twmb/franz-go/pkg/kmsg"
Expand Down Expand Up @@ -69,7 +70,7 @@ func partitionsForMember(member map[string][]int32) int {
func testEqualDivvy(t *testing.T, plan Plan, expSticky int, input []GroupMember) {
t.Helper()

min := 1 << 31
min := math.MaxInt32
max := 0
var stickiness int
for member, topics := range plan {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kgo/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (p *producer) init(cl *Client) {
p.cl = cl
p.topics = newTopicsPartitions()
p.unknownTopics = make(map[string]*unknownTopicProduces)
p.waitBuffer = make(chan struct{}, math.MaxInt64)
p.waitBuffer = make(chan struct{}, math.MaxInt32)
p.idVersion = -1
p.id.Store(&producerID{
id: -1,
Expand Down

0 comments on commit 719c6f4

Please sign in to comment.