Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1147,15 +1147,17 @@ public void start() throws IOException {
metricsTimer.schedule(scheduleOMMetricsWriteTask, 0, period);

keyManager.start(configuration);
omRpcServer.start();
isOmRpcServerRunning = true;

try {
httpServer = new OzoneManagerHttpServer(configuration, this);
httpServer.start();
} catch (Exception ex) {
// Allow OM to start as Http Server failure is not fatal.
LOG.error("OM HttpServer failed to start.", ex);
}
omRpcServer.start();
isOmRpcServerRunning = true;

registerMXBean();

startJVMPauseMonitor();
Expand Down Expand Up @@ -1201,8 +1203,6 @@ public void restart() throws IOException {
}

omRpcServer = getRpcServer(configuration);
omRpcServer.start();
isOmRpcServerRunning = true;

try {
httpServer = new OzoneManagerHttpServer(configuration, this);
Expand All @@ -1211,6 +1211,10 @@ public void restart() throws IOException {
// Allow OM to start as Http Server failure is not fatal.
LOG.error("OM HttpServer failed to start.", ex);
}

omRpcServer.start();
isOmRpcServerRunning = true;

registerMXBean();

startJVMPauseMonitor();
Expand Down Expand Up @@ -2503,13 +2507,15 @@ public List<ServiceInfo> getServiceList() throws IOException {
.setType(ServicePort.Type.RPC)
.setValue(omRpcAddress.getPort())
.build());
if (httpServer.getHttpAddress() != null) {
if (httpServer != null
&& httpServer.getHttpAddress() != null) {
omServiceInfoBuilder.addServicePort(ServicePort.newBuilder()
.setType(ServicePort.Type.HTTP)
.setValue(httpServer.getHttpAddress().getPort())
.build());
}
if (httpServer.getHttpsAddress() != null) {
if (httpServer != null
&& httpServer.getHttpsAddress() != null) {
omServiceInfoBuilder.addServicePort(ServicePort.newBuilder()
.setType(ServicePort.Type.HTTPS)
.setValue(httpServer.getHttpsAddress().getPort())
Expand Down