lianetm commented on code in PR #20521:
URL: https://github.com/apache/kafka/pull/20521#discussion_r2481438192


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:
##########
@@ -878,6 +874,108 @@ public ConsumerRecords<K, V> poll(final Duration timeout) 
{
         }
     }
 
+    /**
+     * {@code checkInflightPoll()} manages the lifetime of the {@link 
AsyncPollEvent} processing. If it is
+     * called when no event is currently processing, it will start a new event 
processing asynchronously. A check
+     * is made during each invocation to see if the <em>inflight</em> event 
has completed. If it has, it will be
+     * processed accordingly.
+     */
+    @SuppressWarnings({"CyclomaticComplexity"})

Review Comment:
   I think we shouldn't suppress this warning, and could simplify instead. 
   
   What about we split a bit? At this point, this func seems more like a 
`maybeTriggerAndCheckPoll` (name as you prefer):
   - the logic between ln 866 and 935 are the maybeTrigger part, 
   - from line 937 on it's about checkInflight.
   
   Wdyt?



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