You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/05/05 21:33:49 UTC

[GitHub] [hbase] markrmiller opened a new pull request #1659: HBASE-24332: TestJMXListener.setupBeforeClass can fail due to not get…

markrmiller opened a new pull request #1659:
URL: https://github.com/apache/hbase/pull/1659


   …ting a random port.


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

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



[GitHub] [hbase] saintstack commented on a change in pull request #1659: HBASE-24332: TestJMXListener.setupBeforeClass can fail due to not get…

Posted by GitBox <gi...@apache.org>.
saintstack commented on a change in pull request #1659:
URL: https://github.com/apache/hbase/pull/1659#discussion_r420473658



##########
File path: hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java
##########
@@ -264,4 +265,34 @@ boolean deleteDir(final File dir) {
       boolean failIfTimeout, Predicate<E> predicate) throws E {
     return Waiter.waitFor(this.conf, timeout, interval, failIfTimeout, predicate);
   }
+
+  private static final PortAllocator portAllocator = new PortAllocator();
+
+  public static int randomFreePort() {
+    try {
+      return portAllocator.randomFreePort();
+    } catch (IOException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  static class PortAllocator {
+
+    public PortAllocator() {
+
+    }
+
+    public int randomFreePort() throws IOException {
+      ServerSocket s = new ServerSocket(0);
+      try {
+        s.setReuseAddress(true);
+        int port = s.getLocalPort();
+        return port;
+      } finally {
+        if (null != s) {
+          s.close();
+        }
+      }
+    }
+  }
 }

Review comment:
       Lets get rid of all impls except this one that you and I moved back into common testing utils.
   
   We get the port number but it could be taken by another by the time we get to use it so handling bindexception seems needed everywhere. Catching has been generalized a bunch but still a few places where we don't catch the bind exception.




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

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



[GitHub] [hbase] markrmiller commented on a change in pull request #1659: HBASE-24332: TestJMXListener.setupBeforeClass can fail due to not get…

Posted by GitBox <gi...@apache.org>.
markrmiller commented on a change in pull request #1659:
URL: https://github.com/apache/hbase/pull/1659#discussion_r420466741



##########
File path: hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java
##########
@@ -264,4 +265,34 @@ boolean deleteDir(final File dir) {
       boolean failIfTimeout, Predicate<E> predicate) throws E {
     return Waiter.waitFor(this.conf, timeout, interval, failIfTimeout, predicate);
   }
+
+  private static final PortAllocator portAllocator = new PortAllocator();
+
+  public static int randomFreePort() {
+    try {
+      return portAllocator.randomFreePort();
+    } catch (IOException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  static class PortAllocator {
+
+    public PortAllocator() {
+
+    }
+
+    public int randomFreePort() throws IOException {
+      ServerSocket s = new ServerSocket(0);
+      try {
+        s.setReuseAddress(true);
+        int port = s.getLocalPort();
+        return port;
+      } finally {
+        if (null != s) {
+          s.close();
+        }
+      }
+    }
+  }
 }

Review comment:
       Yeah, I'm not too concerned how that test itself is addressed, but I think it's good to cleanup getting the port. There are multiple implementations and the one currently used in this test is week and more complicated vs the other of just using port 0 (and properly using setReuseAddrress=true.
   
   You have to also still catch a bind exception because there is a race - it's better to specify 0 for the socket that will actually be used, not see that a port is free and then try to use it (may not be free a second later).
   
   Your solution is isolated to that test though right? The tests that use these other 2 get port methods have the same race, so it seems better to combine the get free port methods into one and make that robust?




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

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



[GitHub] [hbase] Apache-HBase commented on pull request #1659: HBASE-24332: TestJMXListener.setupBeforeClass can fail due to not get…

Posted by GitBox <gi...@apache.org>.
Apache-HBase commented on pull request #1659:
URL: https://github.com/apache/hbase/pull/1659#issuecomment-624403494


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   9m 47s |  Docker mode activated.  |
   | -0 :warning: |  yetus  |   0m  6s |  Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck  |
   ||| _ Prechecks _ |
   ||| _ branch-2 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 14s |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   5m  4s |  branch-2 passed  |
   | +1 :green_heart: |  compile  |   2m  9s |  branch-2 passed  |
   | +1 :green_heart: |  shadedjars  |   6m 15s |  branch has no errors when building our shaded downstream artifacts.  |
   | -0 :warning: |  javadoc  |   0m 18s |  hbase-common in branch-2 failed.  |
   | -0 :warning: |  javadoc  |   0m 22s |  hbase-http in branch-2 failed.  |
   | -0 :warning: |  javadoc  |   0m 43s |  hbase-server in branch-2 failed.  |
   ||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 18s |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   4m 41s |  the patch passed  |
   | +1 :green_heart: |  compile  |   2m  1s |  the patch passed  |
   | +1 :green_heart: |  javac  |   2m  1s |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   6m 15s |  patch has no errors when building our shaded downstream artifacts.  |
   | -0 :warning: |  javadoc  |   0m 17s |  hbase-common in the patch failed.  |
   | -0 :warning: |  javadoc  |   0m 18s |  hbase-http in the patch failed.  |
   | -0 :warning: |  javadoc  |   0m 52s |  hbase-server in the patch failed.  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |   2m 20s |  hbase-common in the patch passed.  |
   | +1 :green_heart: |  unit  |   1m  2s |  hbase-http in the patch passed.  |
   | -1 :x: |  unit  | 211m 22s |  hbase-server in the patch failed.  |
   |  |   | 256m 49s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | Client=19.03.8 Server=19.03.8 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/1659 |
   | JIRA Issue | HBASE-24332 |
   | Optional Tests | javac javadoc unit shadedjars compile |
   | uname | Linux 5c10d3baf882 4.15.0-74-generic #84-Ubuntu SMP Thu Dec 19 08:06:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | branch-2 / 5dc10dbba5 |
   | Default Java | 2020-01-14 |
   | javadoc | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/artifact/yetus-jdk11-hadoop3-check/output/branch-javadoc-hbase-common.txt |
   | javadoc | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/artifact/yetus-jdk11-hadoop3-check/output/branch-javadoc-hbase-http.txt |
   | javadoc | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/artifact/yetus-jdk11-hadoop3-check/output/branch-javadoc-hbase-server.txt |
   | javadoc | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/artifact/yetus-jdk11-hadoop3-check/output/patch-javadoc-hbase-common.txt |
   | javadoc | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/artifact/yetus-jdk11-hadoop3-check/output/patch-javadoc-hbase-http.txt |
   | javadoc | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/artifact/yetus-jdk11-hadoop3-check/output/patch-javadoc-hbase-server.txt |
   | unit | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/artifact/yetus-jdk11-hadoop3-check/output/patch-unit-hbase-server.txt |
   |  Test Results | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/testReport/ |
   | Max. process+thread count | 2534 (vs. ulimit of 12500) |
   | modules | C: hbase-common hbase-http hbase-server U: . |
   | Console output | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/console |
   | versions | git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f) |
   | Powered by | Apache Yetus 0.11.1 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


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

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



[GitHub] [hbase] markrmiller commented on pull request #1659: HBASE-24332: TestJMXListener.setupBeforeClass can fail due to not get…

Posted by GitBox <gi...@apache.org>.
markrmiller commented on pull request #1659:
URL: https://github.com/apache/hbase/pull/1659#issuecomment-624319591


   I pushed this early, have not cleaned up checkstyle and other cleanups yet, but just to show contrasting approach with HBASE-24331


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

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



[GitHub] [hbase] markrmiller commented on a change in pull request #1659: HBASE-24332: TestJMXListener.setupBeforeClass can fail due to not get…

Posted by GitBox <gi...@apache.org>.
markrmiller commented on a change in pull request #1659:
URL: https://github.com/apache/hbase/pull/1659#discussion_r420467753



##########
File path: hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java
##########
@@ -264,4 +265,34 @@ boolean deleteDir(final File dir) {
       boolean failIfTimeout, Predicate<E> predicate) throws E {
     return Waiter.waitFor(this.conf, timeout, interval, failIfTimeout, predicate);
   }
+
+  private static final PortAllocator portAllocator = new PortAllocator();
+
+  public static int randomFreePort() {
+    try {
+      return portAllocator.randomFreePort();
+    } catch (IOException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  static class PortAllocator {
+
+    public PortAllocator() {
+
+    }
+
+    public int randomFreePort() throws IOException {
+      ServerSocket s = new ServerSocket(0);
+      try {
+        s.setReuseAddress(true);
+        int port = s.getLocalPort();
+        return port;
+      } finally {
+        if (null != s) {
+          s.close();
+        }
+      }
+    }
+  }
 }

Review comment:
       I suppose it's hard to make robust universally though. It's a problematic way to get a free ephem port. Just trying to address at these common get free port methods in some better way since they are available and used in a few places.




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

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



[GitHub] [hbase] markrmiller commented on a change in pull request #1659: HBASE-24332: TestJMXListener.setupBeforeClass can fail due to not get…

Posted by GitBox <gi...@apache.org>.
markrmiller commented on a change in pull request #1659:
URL: https://github.com/apache/hbase/pull/1659#discussion_r420466741



##########
File path: hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java
##########
@@ -264,4 +265,34 @@ boolean deleteDir(final File dir) {
       boolean failIfTimeout, Predicate<E> predicate) throws E {
     return Waiter.waitFor(this.conf, timeout, interval, failIfTimeout, predicate);
   }
+
+  private static final PortAllocator portAllocator = new PortAllocator();
+
+  public static int randomFreePort() {
+    try {
+      return portAllocator.randomFreePort();
+    } catch (IOException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  static class PortAllocator {
+
+    public PortAllocator() {
+
+    }
+
+    public int randomFreePort() throws IOException {
+      ServerSocket s = new ServerSocket(0);
+      try {
+        s.setReuseAddress(true);
+        int port = s.getLocalPort();
+        return port;
+      } finally {
+        if (null != s) {
+          s.close();
+        }
+      }
+    }
+  }
 }

Review comment:
       Yeah, I'm not too concerned how that test itself is addressed, but I think it's good to cleanup getting the port. There are multiple implementations and the one currently used in this test is weak and more complicated vs the other of just using port 0 (and properly using setReuseAddrress=true).
   
   You have to also still catch a bind exception because there is a race - it's better to specify 0 for the socket that will actually be used, not see that a port is free and then try to use it (may not be free a second later).
   
   Your solution is isolated to that test though right? The tests that use these other 2 get port methods have the same race, so it seems better to combine the get free port methods into one and make that robust?




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

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



[GitHub] [hbase] markrmiller commented on a change in pull request #1659: HBASE-24332: TestJMXListener.setupBeforeClass can fail due to not get…

Posted by GitBox <gi...@apache.org>.
markrmiller commented on a change in pull request #1659:
URL: https://github.com/apache/hbase/pull/1659#discussion_r420467085



##########
File path: hbase-server/src/test/java/org/apache/hadoop/hbase/util/ProcessBasedLocalHBaseCluster.java
##########
@@ -187,11 +187,19 @@ public void startHBase() throws IOException {
   }
 
   public void startRegionServer(int port) {
-    startServer(ServerType.RS, port);
+    try {
+      startServer(ServerType.RS, port);
+    } catch (IOException e) {
+      throw new RuntimeException(e);

Review comment:
       It just because the new impl for getting the port throws IOException - it has to be caught and dealt with somewhere - until cleanup, it was here. I put this up early since I saw the other issue.




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

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



[GitHub] [hbase] saintstack commented on a change in pull request #1659: HBASE-24332: TestJMXListener.setupBeforeClass can fail due to not get…

Posted by GitBox <gi...@apache.org>.
saintstack commented on a change in pull request #1659:
URL: https://github.com/apache/hbase/pull/1659#discussion_r420435064



##########
File path: hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java
##########
@@ -264,4 +265,34 @@ boolean deleteDir(final File dir) {
       boolean failIfTimeout, Predicate<E> predicate) throws E {
     return Waiter.waitFor(this.conf, timeout, interval, failIfTimeout, predicate);
   }
+
+  private static final PortAllocator portAllocator = new PortAllocator();
+
+  public static int randomFreePort() {
+    try {
+      return portAllocator.randomFreePort();
+    } catch (IOException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  static class PortAllocator {
+
+    public PortAllocator() {
+
+    }
+
+    public int randomFreePort() throws IOException {
+      ServerSocket s = new ServerSocket(0);
+      try {
+        s.setReuseAddress(true);
+        int port = s.getLocalPort();
+        return port;
+      } finally {
+        if (null != s) {
+          s.close();
+        }
+      }
+    }
+  }
 }

Review comment:
       This is funny. I did this moving back of this facility in HBASE-24307

##########
File path: hbase-http/src/test/java/org/apache/hadoop/hbase/http/HttpServerFunctionalTest.java
##########
@@ -272,22 +272,6 @@ protected static void deleteRecursively(File d) {
     d.delete();
   }
 
-  /**
-   * Picks a free port on the host by binding a Socket to '0'.
-   */
-  protected static int getFreePort() throws IOException {
-    ServerSocket s = new ServerSocket(0);
-    try {
-      s.setReuseAddress(true);
-      int port = s.getLocalPort();
-      return port;
-    } finally {
-      if (null != s) {
-        s.close();
-      }
-    }
-  }
-

Review comment:
       I didn't get this. Good that you did.

##########
File path: hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java
##########
@@ -264,4 +265,34 @@ boolean deleteDir(final File dir) {
       boolean failIfTimeout, Predicate<E> predicate) throws E {
     return Waiter.waitFor(this.conf, timeout, interval, failIfTimeout, predicate);
   }
+
+  private static final PortAllocator portAllocator = new PortAllocator();
+
+  public static int randomFreePort() {
+    try {
+      return portAllocator.randomFreePort();
+    } catch (IOException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  static class PortAllocator {
+
+    public PortAllocator() {
+
+    }
+
+    public int randomFreePort() throws IOException {
+      ServerSocket s = new ServerSocket(0);
+      try {
+        s.setReuseAddress(true);
+        int port = s.getLocalPort();
+        return port;
+      } finally {
+        if (null != s) {
+          s.close();
+        }
+      }
+    }
+  }
 }

Review comment:
       I don't think this is enough though. Still need to deal w/ BindException happening.

##########
File path: hbase-server/src/test/java/org/apache/hadoop/hbase/util/ProcessBasedLocalHBaseCluster.java
##########
@@ -187,11 +187,19 @@ public void startHBase() throws IOException {
   }
 
   public void startRegionServer(int port) {
-    startServer(ServerType.RS, port);
+    try {
+      startServer(ServerType.RS, port);
+    } catch (IOException e) {
+      throw new RuntimeException(e);

Review comment:
       This changes behavior? What you thinking here?




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

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



[GitHub] [hbase] markrmiller commented on a change in pull request #1659: HBASE-24332: TestJMXListener.setupBeforeClass can fail due to not get…

Posted by GitBox <gi...@apache.org>.
markrmiller commented on a change in pull request #1659:
URL: https://github.com/apache/hbase/pull/1659#discussion_r420469084



##########
File path: hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java
##########
@@ -264,4 +265,34 @@ boolean deleteDir(final File dir) {
       boolean failIfTimeout, Predicate<E> predicate) throws E {
     return Waiter.waitFor(this.conf, timeout, interval, failIfTimeout, predicate);
   }
+
+  private static final PortAllocator portAllocator = new PortAllocator();
+
+  public static int randomFreePort() {
+    try {
+      return portAllocator.randomFreePort();
+    } catch (IOException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  static class PortAllocator {
+
+    public PortAllocator() {
+
+    }
+
+    public int randomFreePort() throws IOException {
+      ServerSocket s = new ServerSocket(0);
+      try {
+        s.setReuseAddress(true);
+        int port = s.getLocalPort();
+        return port;
+      } finally {
+        if (null != s) {
+          s.close();
+        }
+      }
+    }
+  }
 }

Review comment:
       Let me try and summarize that:
   I think your patch attempts to solve the issue for this test in a solid way.
   With my patch, I'm trying to climb into these getPort util methods and make them more solid - though they cannot necessarily be made as solid.
   
   So I don't think the two things are necessarily exclusive.




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

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



[GitHub] [hbase] Apache-HBase commented on pull request #1659: HBASE-24332: TestJMXListener.setupBeforeClass can fail due to not get…

Posted by GitBox <gi...@apache.org>.
Apache-HBase commented on pull request #1659:
URL: https://github.com/apache/hbase/pull/1659#issuecomment-624338944


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   4m 45s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  1s |  No case conflicting files found.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  Patch does not have any anti-patterns.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any @author tags.  |
   ||| _ branch-2 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 16s |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   3m 34s |  branch-2 passed  |
   | +1 :green_heart: |  checkstyle  |   1m 47s |  branch-2 passed  |
   | -1 :x: |  spotbugs  |   2m 30s |  hbase-common in branch-2 failed.  |
   ||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 14s |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   3m 19s |  the patch passed  |
   | -0 :warning: |  checkstyle  |   0m 13s |  hbase-http: The patch generated 1 new + 13 unchanged - 0 fixed = 14 total (was 13)  |
   | -0 :warning: |  checkstyle  |   1m  8s |  hbase-server: The patch generated 1 new + 218 unchanged - 1 fixed = 219 total (was 219)  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | +1 :green_heart: |  hadoopcheck  |  11m 51s |  Patch does not cause any errors with Hadoop 3.1.2 3.2.1.  |
   | +1 :green_heart: |  spotbugs  |   3m 53s |  the patch passed  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 36s |  The patch does not generate ASF License warnings.  |
   |  |   |  45m  6s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | Client=19.03.8 Server=19.03.8 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/artifact/yetus-general-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/1659 |
   | JIRA Issue | HBASE-24332 |
   | Optional Tests | dupname asflicense spotbugs hadoopcheck hbaseanti checkstyle |
   | uname | Linux 46691fcaaa6b 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | branch-2 / 5dc10dbba5 |
   | spotbugs | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/artifact/yetus-general-check/output/branch-spotbugs-hbase-common.txt |
   | checkstyle | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-http.txt |
   | checkstyle | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-server.txt |
   | Max. process+thread count | 94 (vs. ulimit of 12500) |
   | modules | C: hbase-common hbase-http hbase-server U: . |
   | Console output | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/console |
   | versions | git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f) spotbugs=3.1.12 |
   | Powered by | Apache Yetus 0.11.1 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


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

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



[GitHub] [hbase] Apache-HBase commented on pull request #1659: HBASE-24332: TestJMXListener.setupBeforeClass can fail due to not get…

Posted by GitBox <gi...@apache.org>.
Apache-HBase commented on pull request #1659:
URL: https://github.com/apache/hbase/pull/1659#issuecomment-624405179


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   9m 47s |  Docker mode activated.  |
   | -0 :warning: |  yetus  |   0m  6s |  Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck  |
   ||| _ Prechecks _ |
   ||| _ branch-2 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 14s |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   4m 14s |  branch-2 passed  |
   | +1 :green_heart: |  compile  |   1m 46s |  branch-2 passed  |
   | +1 :green_heart: |  shadedjars  |   5m  7s |  branch has no errors when building our shaded downstream artifacts.  |
   | +1 :green_heart: |  javadoc  |   1m 15s |  branch-2 passed  |
   ||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 14s |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   3m 53s |  the patch passed  |
   | +1 :green_heart: |  compile  |   1m 45s |  the patch passed  |
   | +1 :green_heart: |  javac  |   1m 45s |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   5m  7s |  patch has no errors when building our shaded downstream artifacts.  |
   | +1 :green_heart: |  javadoc  |   1m 12s |  the patch passed  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |   1m 37s |  hbase-common in the patch passed.  |
   | +1 :green_heart: |  unit  |   1m  9s |  hbase-http in the patch passed.  |
   | -1 :x: |  unit  | 225m  1s |  hbase-server in the patch failed.  |
   |  |   | 264m 50s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | Client=19.03.8 Server=19.03.8 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/artifact/yetus-jdk8-hadoop2-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/1659 |
   | JIRA Issue | HBASE-24332 |
   | Optional Tests | javac javadoc unit shadedjars compile |
   | uname | Linux 49b4ff0293a6 4.15.0-74-generic #84-Ubuntu SMP Thu Dec 19 08:06:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | branch-2 / 5dc10dbba5 |
   | Default Java | 1.8.0_232 |
   | unit | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/artifact/yetus-jdk8-hadoop2-check/output/patch-unit-hbase-server.txt |
   |  Test Results | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/testReport/ |
   | Max. process+thread count | 2413 (vs. ulimit of 12500) |
   | modules | C: hbase-common hbase-http hbase-server U: . |
   | Console output | https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1659/1/console |
   | versions | git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f) |
   | Powered by | Apache Yetus 0.11.1 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


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

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



[GitHub] [hbase] markrmiller commented on a change in pull request #1659: HBASE-24332: TestJMXListener.setupBeforeClass can fail due to not get…

Posted by GitBox <gi...@apache.org>.
markrmiller commented on a change in pull request #1659:
URL: https://github.com/apache/hbase/pull/1659#discussion_r420469084



##########
File path: hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtility.java
##########
@@ -264,4 +265,34 @@ boolean deleteDir(final File dir) {
       boolean failIfTimeout, Predicate<E> predicate) throws E {
     return Waiter.waitFor(this.conf, timeout, interval, failIfTimeout, predicate);
   }
+
+  private static final PortAllocator portAllocator = new PortAllocator();
+
+  public static int randomFreePort() {
+    try {
+      return portAllocator.randomFreePort();
+    } catch (IOException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  static class PortAllocator {
+
+    public PortAllocator() {
+
+    }
+
+    public int randomFreePort() throws IOException {
+      ServerSocket s = new ServerSocket(0);
+      try {
+        s.setReuseAddress(true);
+        int port = s.getLocalPort();
+        return port;
+      } finally {
+        if (null != s) {
+          s.close();
+        }
+      }
+    }
+  }
 }

Review comment:
       Let me try and summarize that:
   I think your patch attempts to solve the issue for this test in a solid way.
   With my patch, I'm trying to climb into these getPort util methods and make them more solid - though they cannot necessarily be made as solid.
   
   So I don't think the two things are necessarily mutually exclusive.




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

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