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

Avoid unnecessary lock acquire when KafkaConsumer commits offsets

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.10.2.2, 0.11.0.3, 1.0.2, 1.1.1, 2.0.1, 2.1.0
    • Fix Version/s: 2.3.0
    • Component/s: clients
    • Labels:
      None

      Description

      In KafkaConsumer#commitAsync that does not take offset parameters, we have the following logic:

      public void commitAsync(OffsetCommitCallback callback) {
          acquireAndEnsureOpen();
          try {
              commitAsync(subscriptions.allConsumed(), callback);
          } finally {
              release();
          }
      }
      

      This function calls another commitAsync with default all consumed offset which also call `acquireAndEnsureOpen`.

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lambdaliu lambdaliu
                Reporter:
                lambdaliu lambdaliu
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: