You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "fvaleri (via GitHub)" <gi...@apache.org> on 2023/05/15 08:18:18 UTC

[GitHub] [kafka] fvaleri opened a new pull request, #13720: KAFKA-14997: Fix JmxToolTest failing on CI server

fvaleri opened a new pull request, #13720:
URL: https://github.com/apache/kafka/pull/13720

   (no comment)


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

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


[GitHub] [kafka] vamossagar12 commented on a diff in pull request #13720: KAFKA-14997: Fix JmxToolTest failing on CI server

Posted by "vamossagar12 (via GitHub)" <gi...@apache.org>.
vamossagar12 commented on code in PR #13720:
URL: https://github.com/apache/kafka/pull/13720#discussion_r1193755075


##########
tools/src/test/java/org/apache/kafka/tools/JmxToolTest.java:
##########
@@ -325,11 +327,15 @@ public void dateFormat() {
     }
 
     private static JMXConnectorServer startJmxAgent(int port) throws Exception {
+        // explicitly set the hostname returned to the the clients in the remote stub object
+        // when connecting to a multi-homed machine using RMI, the wrong address may be returned
+        // by the RMI registry to the client, causing the connection to the RMI server to timeout
+        System.setProperty("java.rmi.server.hostname", "localhost");
         LocateRegistry.createRegistry(port);
         Map<String, Object> env = new HashMap<>();
         env.put("com.sun.management.jmxremote.authenticate", "false");
         env.put("com.sun.management.jmxremote.ssl", "false");
-        JMXServiceURL url = new JMXServiceURL(String.format("service:jmx:rmi:///jndi/rmi://:%d/jmxrmi", port));
+        JMXServiceURL url = new JMXServiceURL(format(JMX_URL_TEMPLATE, port));

Review Comment:
   minor nit: Is it possible to reuse the `jmxUrl` object created in `beforeAll`? The object passed in the `JMXServiceURL` seems to be the same as `jmxUrl`.



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

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


[GitHub] [kafka] showuon commented on pull request #13720: KAFKA-14997: Fix JmxToolTest failing on CI server

Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on PR #13720:
URL: https://github.com/apache/kafka/pull/13720#issuecomment-1548876268

   Failed tests are unrelated:
   ```
       Build / JDK 11 and Scala 2.13 / org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationExactlyOnceTest.testOffsetTranslationBehindReplicationFlow()
       Build / JDK 11 and Scala 2.13 / org.apache.kafka.connect.mirror.integration.MirrorConnectorsWithCustomForwardingAdminIntegrationTest.testOffsetTranslationBehindReplicationFlow()
       Build / JDK 17 and Scala 2.13 / org.apache.kafka.connect.integration.OffsetsApiIntegrationTest.testGetSinkConnectorOffsetsDifferentKafkaClusterTargeted
       Build / JDK 8 and Scala 2.12 / kafka.api.PlaintextConsumerTest.testAsyncCommit()
   ```


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

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


[GitHub] [kafka] showuon commented on pull request #13720: KAFKA-14997: Fix JmxToolTest failing on CI server

Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on PR #13720:
URL: https://github.com/apache/kafka/pull/13720#issuecomment-1548878693

   Reviewers: Luke Chen <sh...@gmail.com>, vamossagar12 <sa...@gmail.com>, Kamal Chandraprakash <ka...@gmail.com>, hudeqi <16...@bjtu.edu.cn>, Christo Lolov <ch...@gmail.com>


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

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


[GitHub] [kafka] fvaleri commented on a diff in pull request #13720: KAFKA-14997: Fix JmxToolTest failing on CI server

Posted by "fvaleri (via GitHub)" <gi...@apache.org>.
fvaleri commented on code in PR #13720:
URL: https://github.com/apache/kafka/pull/13720#discussion_r1193803195


##########
tools/src/test/java/org/apache/kafka/tools/JmxToolTest.java:
##########
@@ -325,11 +327,15 @@ public void dateFormat() {
     }
 
     private static JMXConnectorServer startJmxAgent(int port) throws Exception {
+        // explicitly set the hostname returned to the the clients in the remote stub object
+        // when connecting to a multi-homed machine using RMI, the wrong address may be returned
+        // by the RMI registry to the client, causing the connection to the RMI server to timeout
+        System.setProperty("java.rmi.server.hostname", "localhost");
         LocateRegistry.createRegistry(port);
         Map<String, Object> env = new HashMap<>();
         env.put("com.sun.management.jmxremote.authenticate", "false");
         env.put("com.sun.management.jmxremote.ssl", "false");
-        JMXServiceURL url = new JMXServiceURL(String.format("service:jmx:rmi:///jndi/rmi://:%d/jmxrmi", port));
+        JMXServiceURL url = new JMXServiceURL(format(JMX_URL_TEMPLATE, port));

Review Comment:
   Sure, but I need to move that code inside beforeAll. I think it's better. 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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] showuon merged pull request #13720: KAFKA-14997: Fix JmxToolTest failing on CI server

Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon merged PR #13720:
URL: https://github.com/apache/kafka/pull/13720


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

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


[GitHub] [kafka] fvaleri commented on pull request #13720: KAFKA-14997: Fix JmxToolTest failing on CI server

Posted by "fvaleri (via GitHub)" <gi...@apache.org>.
fvaleri commented on PR #13720:
URL: https://github.com/apache/kafka/pull/13720#issuecomment-1547718210

   CI job completed successfully. Failing tests are unrelated.


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

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