diff --git a/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectCommunicator.java b/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectCommunicator.java index 6c1a3368133..09a7f3c1104 100644 --- a/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectCommunicator.java +++ b/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectCommunicator.java @@ -345,7 +345,8 @@ public class AutodetectCommunicator implements Closeable { @Override public void onFailure(Exception e) { if (processKilled) { - handler.accept(null, null); + handler.accept(null, ExceptionsHelper.conflictStatusException( + "[{}] Could not submit operation to process as it has been killed", job.getId())); } else { LOGGER.error(new ParameterizedMessage("[{}] Unexpected exception writing to process", job.getId()), e); handler.accept(null, e); @@ -355,7 +356,8 @@ public class AutodetectCommunicator implements Closeable { @Override protected void doRun() throws Exception { if (processKilled) { - handler.accept(null, null); + handler.accept(null, ExceptionsHelper.conflictStatusException( + "[{}] Could not submit operation to process as it has been killed", job.getId())); } else { checkProcessIsAlive(); handler.accept(operation.get(), null);