Skip to content

Commit

Permalink
[8.3] [ML] Add exception detail to auditor failure to install template (
Browse files Browse the repository at this point in the history
#88509)

While looking at a different issue I noticed cases of the
ML auditor failing to install its template. Unfortunately
this log message didn't include the exception, so it was
not possible to say for sure why this happened. This PR
adds the exception.

Backport of #88498
  • Loading branch information
droberts195 committed Jul 13, 2022
1 parent 8fcc4ca commit ab0f013
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.elasticsearch.client.internal.OriginSettingClient;
import org.elasticsearch.cluster.metadata.ComposableIndexTemplate;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.core.Strings;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.xcontent.ToXContent;
import org.elasticsearch.xcontent.XContentBuilder;
Expand Down Expand Up @@ -140,10 +141,10 @@ protected void indexDoc(ToXContent toXContent) {
hasLatestTemplate.set(true);
}
logger.info("Auditor template [{}] successfully installed", templateName);
writeBacklog();
putTemplateInProgress.set(false);
writeBacklog();
}, e -> {
logger.warn("Error putting latest template [{}]", templateName);
logger.warn(Strings.format("Error putting latest template [%s]", templateName), e);
putTemplateInProgress.set(false);
});

Expand All @@ -158,7 +159,7 @@ protected void indexDoc(ToXContent toXContent) {
}
backlog.add(toXContent);
} else {
logger.error("Latest audit template missing but the back log has been written");
logger.error("Latest audit template missing and audit message cannot be added to the backlog");
}

// stop multiple invocations
Expand Down

0 comments on commit ab0f013

Please sign in to comment.