kirktrue commented on code in PR #21457:
URL: https://github.com/apache/kafka/pull/21457#discussion_r2824977448


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/SubscriptionState.java:
##########
@@ -659,14 +659,25 @@ public synchronized Long 
partitionEndOffset(TopicPartition tp, IsolationLevel is
 
     public synchronized void requestPartitionEndOffset(TopicPartition tp) {
         TopicPartitionState topicPartitionState = assignedState(tp);
-        topicPartitionState.requestEndOffset();
+        topicPartitionState.setRequestEndOffset(true);
     }
 
     public synchronized boolean partitionEndOffsetRequested(TopicPartition tp) 
{
         TopicPartitionState topicPartitionState = assignedState(tp);
         return topicPartitionState.endOffsetRequested();
     }
 
+    public synchronized boolean 
maybeClearPartitionEndOffsetRequested(TopicPartition tp) {
+        TopicPartitionState topicPartitionState = assignedStateOrNull(tp);
+
+        if (topicPartitionState != null && 
topicPartitionState.endOffsetRequested()) {
+            topicPartitionState.setRequestEndOffset(false);
+            return true;
+        } else {
+            return false;

Review Comment:
   @lianetm—are you OK with leaving the logging in `OffsetFetcherUtils` or 
should we move it to `SubscriptionState`?



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