Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-10337

Wait for pending async commits in commitSync() even if no offsets are specified

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.6.0
    • clients
    • None

    Description

      The JavaDoc for commitSync() states the following:

      Note that asynchronous offset commits sent previously with the

      Unknown macro: {@link #commitAsync(OffsetCommitCallback)}

      (or similar) are guaranteed to have their callbacks invoked prior to completion of this method.

      But should we happen to call the method with an empty offset map
      (i.e. commitSync(Collections.emptyMap())) the callbacks for any incomplete async commits will not be invoked because of an early return in ConsumerCoordinator.commitOffsetsSync() when the input map is empty.

      If users are doing manual offset commits and relying on commitSync as a barrier for in-flight async commits prior to a rebalance, this could be an important (though somewhat implementation-dependent) detail.

      Attachments

        Activity

          People

            erikvanoosten Erik van Oosten
            thomaslee Tom Lee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: