Skip to content

Commit

Permalink
balancing: LogLevelError if BalanceOrError returns an error
Browse files Browse the repository at this point in the history
  • Loading branch information
twmb committed May 1, 2022
1 parent e8e5117 commit b457742
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/kgo/group_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,13 +451,13 @@ func (g *groupConsumer) balanceGroup(proto string, members []kmsg.JoinGroupRespo
// more useful debugging information.
var into IntoSyncAssignment
if memberBalancerOrErr, ok := memberBalancer.(GroupMemberBalancerOrError); ok {
into, err = memberBalancerOrErr.BalanceOrError(topicPartitionCount)
if into, err = memberBalancerOrErr.BalanceOrError(topicPartitionCount); err != nil {
g.cl.cfg.logger.Log(LogLevelError, "balance failed", "err", err)
return nil, err
}
} else {
into = memberBalancer.Balance(topicPartitionCount)
}
if err != nil {
return nil, err
}

if p, ok := into.(*BalancePlan); ok {
g.cl.cfg.logger.Log(LogLevelInfo, "balanced", "plan", p.String())
Expand Down

0 comments on commit b457742

Please sign in to comment.