[7.x][ML] Catch any error thrown while closing data frame analytics process (#44958) (#44968)

In case closing the process throws an exception we should be catching
it no matter its type. The process may have terminated because of a
fatal error in which case closing the process will throw a server
error, not an `IOException`. If this happens we fail to mark the
persistent task as failed and the task gets in limbo.
This commit is contained in:
Dimitris Athanasiou 2019-07-29 21:59:10 +03:00 committed by GitHub
parent 3b514f0dae
commit aef419c0b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -203,7 +203,7 @@ public class AnalyticsProcessManager {
try {
processContext.process.close();
LOGGER.info("[{}] Closed process", configId);
} catch (IOException e) {
} catch (Exception e) {
String errorMsg = new ParameterizedMessage("[{}] Error closing data frame analyzer process [{}]"
, configId, e.getMessage()).getFormattedMessage();
processContext.setFailureReason(errorMsg);