HBASE-24197 TestHttpServer.testBindAddress failure with latest jetty (#1524)
use the findPort logic even if the BindException is wrapped in an IOException Signed-off-by: Viraj Jasani <vjasani@apache.org> Signed-off-by: Jan Hentschel <jan.hentschel@ultratendency.com> Signed-off-by: Peter Somogyi <psomogyi@apache.org>
This commit is contained in:
parent
360baf9dd6
commit
ec266a0743
|
@ -1120,7 +1120,10 @@ public class HttpServer implements FilterContainer {
|
|||
listener.open();
|
||||
LOG.info("Jetty bound to port " + listener.getLocalPort());
|
||||
break;
|
||||
} catch (BindException ex) {
|
||||
} catch (IOException ex) {
|
||||
if(!(ex instanceof BindException) && !(ex.getCause() instanceof BindException)) {
|
||||
throw ex;
|
||||
}
|
||||
if (port == 0 || !findPort) {
|
||||
BindException be = new BindException("Port in use: "
|
||||
+ listener.getHost() + ":" + listener.getPort());
|
||||
|
|
Loading…
Reference in New Issue