Skip to content

Commit cfbb4dc

Browse files
authored
Merge branch 'main' into toml
2 parents 584ea7c + f288817 commit cfbb4dc

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

platform-service-framework/src/main/java/org/hypertrace/core/serviceframework/PlatformService.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ public void start() {
148148
adminServer.join();
149149
} catch (Exception e) {
150150
LOGGER.error("Failed to start service servlet.");
151+
this.shutdown();
152+
System.exit(1);
151153
}
152154
}
153155

@@ -175,12 +177,6 @@ public void shutdown() {
175177
} catch (Exception ex) {
176178
LOGGER.error("Error stopping admin server");
177179
}
178-
if (getServiceState() != State.STARTED) {
179-
LOGGER.info(
180-
"Service - {} is at state: {}. Expecting state: STARTED. Skipping shutdown...",
181-
getServiceName(), getServiceState());
182-
return;
183-
}
184180
LOGGER.info("Trying to shutdown service - {}...", getServiceName());
185181
serviceLifecycle.setState(State.STOPPING);
186182
doStop();
@@ -189,5 +185,4 @@ public void shutdown() {
189185
PlatformMetricsRegistry.stop();
190186
LOGGER.info("Service - {} is shutdown.", getServiceName());
191187
}
192-
193188
}

0 commit comments

Comments
 (0)