fix: incorrect error check in autoCommitLoop (#15149)

pull/14565/head
George Robinson 6 months ago committed by GitHub
parent 2eea54692e
commit 4b5925a28e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      pkg/kafka/partition/committer.go

@ -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
}
}
}

Loading…
Cancel
Save