lucasbru commented on code in PR #15693:
URL: https://github.com/apache/kafka/pull/15693#discussion_r1601290415


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java:
##########
@@ -1061,25 +1069,29 @@ private RequestFuture<Void> doCommitOffsetsAsync(final 
Map<TopicPartition, Offse
         future.addListener(new RequestFutureListener<Void>() {
             @Override
             public void onSuccess(Void value) {
-                inFlightAsyncCommits.decrementAndGet();
-
-                if (interceptors != null)
-                    interceptors.onCommit(offsets);
-                completedOffsetCommits.add(new OffsetCommitCompletion(cb, 
offsets, null));
+                try {
+                    if (interceptors != null)
+                        interceptors.onCommit(offsets);
+                    completedOffsetCommits.add(new OffsetCommitCompletion(cb, 
offsets, null));
+                } finally {
+                    inFlightAsyncCommits.decrementAndGet();
+                }
             }
 
             @Override
             public void onFailure(RuntimeException e) {
-                inFlightAsyncCommits.decrementAndGet();
+                try {
+                    Exception commitException = e;
 
-                Exception commitException = e;
-
-                if (e instanceof RetriableException) {
-                    commitException = new RetriableCommitFailedException(e);
-                }
-                completedOffsetCommits.add(new OffsetCommitCompletion(cb, 
offsets, commitException));
-                if (commitException instanceof FencedInstanceIdException) {
-                    asyncCommitFenced.set(true);
+                    if (e instanceof RetriableException) {
+                        commitException = new 
RetriableCommitFailedException(e);
+                    }
+                    completedOffsetCommits.add(new OffsetCommitCompletion(cb, 
offsets, commitException));
+                    if (commitException instanceof FencedInstanceIdException) {

Review Comment:
   `FencedInstanceIdException` is not retriable, so this shouldn't make a 
difference, right?



-- 
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