[ML] Don't try to gracefully shut down the controller on unsupported platforms (elastic/x-pack-elasticsearch#1384)

It just wastes 20 seconds while we timeout trying to open named pipes that cannot
possibly have been created.

Original commit: elastic/x-pack-elasticsearch@4e447874f6
This commit is contained in:
David Roberts 2017-05-10 16:03:16 +01:00 committed by GitHub
parent 1994b42cd5
commit 7a32304f2c
1 changed files with 5 additions and 3 deletions

View File

@ -28,9 +28,11 @@ public class MlLifeCycleService extends AbstractComponent {
public synchronized void stop() {
try {
NativeController nativeController = NativeControllerHolder.getNativeController(settings);
if (nativeController != null) {
nativeController.stop();
if (MachineLearningFeatureSet.isRunningOnMlPlatform(false)) {
NativeController nativeController = NativeControllerHolder.getNativeController(settings);
if (nativeController != null) {
nativeController.stop();
}
}
} catch (IOException e) {
// We're stopping anyway, so don't let this complicate the shutdown sequence