squah-confluent commented on code in PR #23688:
URL: https://github.com/apache/kafka/pull/23688#discussion_r4239527734


##########
coordinator-common/src/testFixtures/java/org/apache/kafka/coordinator/common/runtime/MockCoordinatorExecutor.java:
##########
@@ -103,4 +104,17 @@ public List<ExecutorResult<T>> poll() {
         queue.clear();
         return results;
     }
+
+    public ExecutorResult<T> poll(String key) {
+        Iterator<ExecutorTask<?>> it = queue.iterator();
+        while (it.hasNext()) {
+            ExecutorTask<?> task = it.next();
+            if (task.key.equals(key)) {
+                it.remove();
+                tasks.remove(task.key, task.task);
+                return new ExecutorResult<>(task.key, task.execute());
+            }
+        }
+        return null;
+    }

Review Comment:
   That is what it does. I don't follow what you mean. The real coordinator 
executor does not have ordering guarantees when there are multiple executor 
threads.
   
   The test that uses it is 
`testConsumerGroupAsyncTargetAssignmentCancelledOnRollbackAfterRegexResolution` 
and it wants a specific order where regex resolution completes and bumps the 
epoch before the async assignor.



##########
core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala:
##########
@@ -3880,11 +3880,14 @@ class PlaintextAdminIntegrationTest extends 
BaseAdminIntegrationTest {
       new Thread {
         override def run : Unit = {
           consumer.subscribe(util.Set.of(topic))
+          var started = false
           try {
             while (consumerThreadRunning.get()) {
               consumer.poll(JDuration.ofSeconds(5))
-              if (!consumer.assignment.isEmpty && startLatch.getCount > 0L)
+              if (!started && !consumer.assignment.isEmpty) {

Review Comment:
   It comes from https://github.com/apache/kafka/pull/23702. The original code 
allowed the earlier consumers to bump the latch multiple times while the newer 
consumers wait behind the assignment batching or offload delay.
   



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