Skip to content

Commit

Permalink
Merge pull request #712 from 0xgirish/master
Browse files Browse the repository at this point in the history
fix: client.Lag doesn't calculate lag for all consumergroups with client.Lag(ctx)
  • Loading branch information
twmb authored May 26, 2024
2 parents f71ee63 + 823ff5b commit 556abe3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/kadm/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,13 @@ func (cl *Client) Lag(ctx context.Context, groups ...string) (DescribedGroupLags
}
if g.Err != nil {
delete(set, g.Group)
continue
}

// If the input set of groups is empty, DescribeGroups returns all groups.
// We add to `set` here so that the Lag function itself can calculate
// lag for all groups.
set[g.Group] = struct{}{}
}
if len(set) == 0 {
return lags, nil
Expand Down

0 comments on commit 556abe3

Please sign in to comment.