[ML] Kill process after executor has shutdown (elastic/x-pack-elasticsearch#3958)
Original commit: elastic/x-pack-elasticsearch@7dd1467e5ab39eb69b5977e376a7908c8b6fd51c
@@ -187,8 +187,8 @@ public class AutodetectCommunicator implements Closeable {
try {
processKilled = true;
autoDetectResultProcessor.setProcessKilled();
- autodetectProcess.kill();
autodetectWorkerExecutor.shutdown();
+ autodetectProcess.kill();
if (awaitCompletion) {
try {
