diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RegressionIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RegressionIT.java index ee4e94addcf64..e8d36e268072e 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RegressionIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RegressionIT.java @@ -16,8 +16,8 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchModule; @@ -36,12 +36,11 @@ import org.elasticsearch.xpack.core.ml.inference.preprocessing.OneHotEncoding; import org.elasticsearch.xpack.core.ml.inference.preprocessing.PreProcessor; import org.junit.After; -import org.junit.Before; import java.io.IOException; import java.time.Instant; -import java.util.Arrays; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -49,7 +48,6 @@ import java.util.Set; import static org.elasticsearch.test.hamcrest.OptionalMatchers.isPresent; -import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; @@ -80,23 +78,9 @@ public class RegressionIT extends MlNativeDataFrameAnalyticsIntegTestCase { private String sourceIndex; private String destIndex; - @Before - public void setupLogging() { - client().admin().cluster() - .prepareUpdateSettings() - .setTransientSettings(Settings.builder() - .put("logger.org.elasticsearch.xpack.ml.process.logging.CppLogMessageHandler", "DEBUG")) - .get(); - } - @After public void cleanup() { cleanUp(); - client().admin().cluster() - .prepareUpdateSettings() - .setTransientSettings(Settings.builder() - .putNull("logger.org.elasticsearch.xpack.ml.process.logging.CppLogMessageHandler")) - .get(); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsProcessManager.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsProcessManager.java index e1cc9f186b2f7..e8556e37d03b3 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsProcessManager.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsProcessManager.java @@ -324,10 +324,16 @@ private void closeProcess(DataFrameAnalyticsTask task) { processContext.process.get().close(); LOGGER.info("[{}] Closed process", configId); } catch (Exception e) { - LOGGER.error("[" + configId + "] Error closing data frame analyzer process", e); - String errorMsg = new ParameterizedMessage( - "[{}] Error closing data frame analyzer process [{}]", configId, e.getMessage()).getFormattedMessage(); - processContext.setFailureReason(errorMsg); + if (task.isStopping()) { + LOGGER.debug(() -> new ParameterizedMessage( + "[{}] Process closing was interrupted by kill request due to the task being stopped", configId), e); + LOGGER.info("[{}] Closed process", configId); + } else { + LOGGER.error("[" + configId + "] Error closing data frame analyzer process", e); + String errorMsg = new ParameterizedMessage( + "[{}] Error closing data frame analyzer process [{}]", configId, e.getMessage()).getFormattedMessage(); + processContext.setFailureReason(errorMsg); + } } }