move PinotSM shutdownhook to cleanup method
@@ -149,6 +149,7 @@ public class StartServiceManagerCommand extends AbstractBaseAdminCommand impleme
@Override
public void cleanup() {
+ _pinotServiceManager.stopAll();
}
@Override
@@ -182,7 +183,6 @@ public class StartServiceManagerCommand extends AbstractBaseAdminCommand impleme
if (!startBootstrapServices()) {
return false;
}
- Runtime.getRuntime().addShutdownHook(new Thread(() -> _pinotServiceManager.stopAll()));
String pidFile = ".pinotAdminService-" + System.currentTimeMillis() + ".pid";
savePID(System.getProperty("java.io.tmpdir") + File.separator + pidFile);
return true;
