You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Tom Lee (Jira)" <ji...@apache.org> on 2020/08/02 02:22:00 UTC

[jira] [Created] (KAFKA-10337) Wait for pending async commits in commitSync() even if no offsets are specified

Tom Lee created KAFKA-10337:
-------------------------------

             Summary: Wait for pending async commits in commitSync() even if no offsets are specified
                 Key: KAFKA-10337
                 URL: https://issues.apache.org/jira/browse/KAFKA-10337
             Project: Kafka
          Issue Type: Bug
          Components: clients
            Reporter: Tom Lee


The JavaDoc for commitSync() states the following:
{quote}Note that asynchronous offset commits sent previously with the
{@link #commitAsync(OffsetCommitCallback)}
 (or similar) are guaranteed to have their callbacks invoked prior to completion of this method.
{quote}
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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)