You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "kirktrue (via GitHub)" <gi...@apache.org> on 2023/05/10 17:33:29 UTC
[GitHub] [kafka] kirktrue commented on a diff in pull request #13678: KAFKA-10337: await async commits in commitSync even if no offsets given
kirktrue commented on code in PR #13678:
URL: https://github.com/apache/kafka/pull/13678#discussion_r1190210077
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java:
##########
@@ -1132,6 +1136,7 @@ public void onSuccess(Void value) {
if (interceptors != null)
interceptors.onCommit(offsets);
completedOffsetCommits.add(new OffsetCommitCompletion(cb, offsets, null));
+ inFlightAsyncCommits.decrementAndGet();
Review Comment:
Can we wrap the `decrementAndGet` calls in a `try`/`finally` block in case something weird happens in the code that comes before it?
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java:
##########
@@ -1145,6 +1150,7 @@ public void onFailure(RuntimeException e) {
if (commitException instanceof FencedInstanceIdException) {
asyncCommitFenced.set(true);
}
+ inFlightAsyncCommits.decrementAndGet();
Review Comment:
I'm not sure if we need to wrap the `decrementAndGet` call in a `try`/`finally` block here, too?
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org