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


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/CoordinatorRequestManagerTest.java:
##########
@@ -75,6 +83,65 @@ public void testSuccessfulResponse() {
         assertEquals(Collections.emptyList(), pollResult.unsentRequests);
     }
 
+    /**
+     * This test mimics a client that has been disconnected from the 
coordinator. When the client remains disconnected
+     * from the coordinator for 60 seconds, the client will begin to emit a 
warning log every minute thereafter to
+     * alert the user about the ongoing disconnect status. The warning log 
includes the length of time of the ongoing
+     * disconnect.
+     *
+     * <p/>
+     *
+     * However, the logic used to calculate the length of the disconnect was 
not correct. This test exercises the
+     * disconnect logic, controlling the logging and system time, to ensure 
the warning message is correct.
+     *
+     * @see CoordinatorRequestManager#markCoordinatorUnknown(String, long)
+     */
+    @Test
+    public void testMarkCoordinatorUnknownLoggingAccuracy() {
+        long oneMinute = 60000;
+
+        try (final LogCaptureAppender appender = 
LogCaptureAppender.createAndRegister()) {
+            appender.setClassLogger(CoordinatorRequestManager.class, 
Level.DEBUG);

Review Comment:
   Double-checking now, the warning message is logged at `DEBUG` in 
[`CoordinatorRequestManager.java`](https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/consumer/internals/CoordinatorRequestManager.java#L158),
 so I believe the code is correct as-is. PLMK if I'm misunderstanding. Thanks!



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