Why does not tomcat throw an exception when server.start failed with a socket binding error.
https://github.com/apache/incubator-dubbo/blob/master/dubbo-remoting/dubbo-remoting-http/src/main/java/org/apache/dubbo/remoting/http/tomcat/TomcatHttpServer.java#L71
I do see the exception stack printed on the Console, whereas no exception was thrown in here:
try {
tomcat.start();
} catch (LifecycleException e) {
throw new IllegalStateException("Failed to start tomcat server at " + url.getAddress(), e);
} catch (Exception ee) {
throw new IllegalStateException(e);
}
This behavior will cause a tomcat based HTTP service being registered unexpectedly to the Registry even after the binding has failed.
@Override
public <T> Exporter<T> export(final Invoker<T> originInvoker) throws RpcException {
... ...
// socket binding exception extected
final ExporterChangeableWrapper<T> exporter = doLocalExport(originInvoker, providerUrl);
... ...
// url to registry
final Registry registry = getRegistry(originInvoker);
register(registryUrl, registeredProviderUrl);
return new DestroyableExporter<>(exporter);
}
Why does not tomcat throw an exception when
server.startfailed with a socket binding error.https://github.com/apache/incubator-dubbo/blob/master/dubbo-remoting/dubbo-remoting-http/src/main/java/org/apache/dubbo/remoting/http/tomcat/TomcatHttpServer.java#L71
I do see the exception stack printed on the Console, whereas no exception was thrown in here:
This behavior will cause a tomcat based HTTP service being registered unexpectedly to the Registry even after the binding has failed.