apoorvmittal10 commented on code in PR #20895:
URL: https://github.com/apache/kafka/pull/20895#discussion_r2533595942


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumerImpl.java:
##########
@@ -892,8 +892,12 @@ public Uuid clientInstanceId(final Duration timeout) {
      */
     @Override
     public Optional<Integer> acquisitionLockTimeoutMs() {
-        // To be implemented
-        return Optional.empty();
+        acquireAndEnsureOpen();

Review Comment:
   For my understanding: Why do we need to acquire a lock for reading data from 
currentFetch?



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareFetch.java:
##########
@@ -67,6 +70,9 @@ public void add(TopicIdPartition partition, 
ShareInFlightBatch<K, V> batch) {
             // but it might conceivably happen in some rare cases (such as 
partition leader changes).
             currentBatch.merge(batch);
         }
+        if (batch.getAcquisitionLockTimeoutMs().isPresent()) {

Review Comment:
   Why do we need `isPresent` check rather just set to the one from batch?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to