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

Avoid unnecessary lock acquire when KafkaConsumer commits offsets

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.10.2.2, 0.11.0.3, 1.0.2, 1.1.1, 2.0.1, 2.1.0
    • 2.3.0
    • clients
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: