Skip to content

Commit

Permalink
fix: incorrect error check in autoCommitLoop (#15149)
Browse files Browse the repository at this point in the history
  • Loading branch information
grobinson-grafana authored Nov 27, 2024
1 parent 2eea546 commit 4b5925a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/kafka/partition/committer.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,13 @@ func (c *partitionCommitter) autoCommitLoop(ctx context.Context) {
continue
}

if err := c.Commit(ctx, currOffset); err == nil {
level.Error(c.logger).Log("msg", "failed to commit", "offset", currOffset)
c.lastCommittedOffset.Set(float64(currOffset))
previousOffset = currOffset
if err := c.Commit(ctx, currOffset); err != nil {
level.Error(c.logger).Log("msg", "failed to commit", "offset", currOffset, "err", err)
continue
}

c.lastCommittedOffset.Set(float64(currOffset))
previousOffset = currOffset
}
}
}
Expand Down

0 comments on commit 4b5925a

Please sign in to comment.