Github user kkhatua commented on a diff in the pull request: https://github.com/apache/drill/pull/1203#discussion_r182501277 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java --- @@ -189,11 +189,16 @@ public void run() throws Exception { drillbitContext.getOptionManager().init(); javaPropertiesToSystemOptions(); manager.getContext().getRemoteFunctionRegistry().init(context.getConfig(), storeProvider, coord); - registrationHandle = coord.register(md); webServer.start(); - + //Discovering HTTP port (in case of port hunting) + if (webServer.isRunning()) { + int httpPort = getWebServerPort(); + registrationHandle = coord.register(md.toBuilder().setHttpPort(httpPort).build()); + } else { + //WebServer is not running + registrationHandle = coord.register(md); + } --- End diff -- Done.
---