Skip to content

Async acks: pending ack is dropped when the error handler resubmits retained records #4879

Closed

Description

@sharanggupta

With asyncAcks=true and an error handler that retains records (DefaultErrorHandler.setSeekAfterError(false)), doPoll() resubmits the retained records and captureOffsets() replaces the offset lists of the whole batch. An ack still pending for a record of another partition from the same poll then fails the identity check from GH-4687 and is ignored as an obsolete batch.

Reproduction: one poll returns foo-0:[a1] and foo-1:[b1, b2]. The listener keeps the Acknowledgment of a1, throws once on b1 and acks the rest. Acking a1 afterwards should commit foo-0 offset 1, but nothing is committed, so a1 is redelivered after a rebalance or restart.

I have a fix with a test on a branch and can open a PR.

Activity

  1. added this to the 4.2.0 milestone on Nov 12, 2026
  2. added 2 commits that reference this issue on Nov 12, 2026
  3. added a commit that references this issue on Nov 12, 2026
  4. added a commit that references this issue on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions