AndrewJSchofield commented on code in PR #21457:
URL: https://github.com/apache/kafka/pull/21457#discussion_r2821725016
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetFetcher.java:
##########
@@ -153,11 +169,17 @@ public void onSuccess(ListOffsetResult value) {
remainingToSearch.keySet().retainAll(value.partitionsToRetry);
offsetFetcherUtils.updateSubscriptionState(value.fetchedOffsets,
isolationLevel);
+
+ if (isZeroTimestamp && shouldClearPartitionEndOffsets)
Review Comment:
This is too twisty I'm afraid. A few points.
* I wonder whether it might be better to call
`subscriptions.requestPartitionEndOffset` in this method too. Then you are
setting it and clearing it all together.
* The flag `isZeroTimestamp` seems misnamed to me. `isZeroTimeout` surely.
* I think that `isZeroTimestamp` (and the equivalent `timer.timeoutMs() ==
0L`) has a couple of effects. First, it clears the partition end offset
requests flag when the future completes. Second, it exits the loop midway
through the first iteration without polling the client.
* I would change the check `if (timer.timeoutMs() == 0L` to use
`isZeroTimeout` 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]