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


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManager.java:
##########
@@ -163,6 +176,32 @@ public NetworkClientDelegate.PollResult poll(long 
currentTimeMs) {
         return new 
NetworkClientDelegate.PollResult(heartbeatRequestState.heartbeatIntervalMs, 
Collections.singletonList(request));
     }
 
+    public void partitionAssignmentChangedCallbacksInvoked(Set<TopicPartition> 
revokedPartitions,
+                                                           Set<TopicPartition> 
assignedPartitions,
+                                                           
Optional<KafkaException> callbackError) {
+        if (callbackError.isPresent()) {
+            // TODO: how to react to callback errors?
+            //       return?
+        }
+
+        assignmentReconciler.reconciliationCallbacksInvoked(revokedPartitions, 
assignedPartitions);
+
+        // Reset the timer to 0 to force a heartbeat request to be sent out at 
the next call to poll().
+        heartbeatRequestState.resetTimer(0);
+    }
+
+    public void partitionAssignmentLostCallbackInvoked(Set<TopicPartition> 
lostPartitions, Optional<KafkaException> callbackError) {
+        if (callbackError.isPresent()) {
+            // TODO: how to react to callback errors?
+            //       return?
+        }
+
+        assignmentReconciler.lostCallbackInvoked();

Review Comment:
   Need to update state in the membership manager



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManager.java:
##########
@@ -163,6 +176,32 @@ public NetworkClientDelegate.PollResult poll(long 
currentTimeMs) {
         return new 
NetworkClientDelegate.PollResult(heartbeatRequestState.heartbeatIntervalMs, 
Collections.singletonList(request));
     }
 
+    public void partitionAssignmentChangedCallbacksInvoked(Set<TopicPartition> 
revokedPartitions,
+                                                           Set<TopicPartition> 
assignedPartitions,
+                                                           
Optional<KafkaException> callbackError) {
+        if (callbackError.isPresent()) {
+            // TODO: how to react to callback errors?
+            //       return?
+        }
+
+        assignmentReconciler.reconciliationCallbacksInvoked(revokedPartitions, 
assignedPartitions);

Review Comment:
   Need to update state in the membership manager



-- 
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-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to