dajac commented on code in PR #14090:
URL: https://github.com/apache/kafka/pull/14090#discussion_r1274860005


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/runtime/CoordinatorRuntime.java:
##########
@@ -1187,63 +1230,62 @@ public void scheduleLoadOperation(
     ) {
         throwIfNotRunning();
         log.info("Scheduling loading of metadata from {} with epoch {}", tp, 
partitionEpoch);
+
         // Touch the state to make the runtime immediately aware of the new 
coordinator.
-        getOrCreateContext(tp);
+        maybeCreateContext(tp);
 
         scheduleInternalOperation("Load(tp=" + tp + ", epoch=" + 
partitionEpoch + ")", tp, () -> {
-            CoordinatorContext context = getOrCreateContext(tp);
-
-            if (context.state == CoordinatorState.FAILED) {
-                // When the coordinator has failed, we create a new context 
instead of

Review Comment:
   Correct. I found out that when using the lock in the context, it is actually 
easier/better to reuse vs to recreate it because when you delete it, you loose 
the lock.



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