From 6893699f06ed5e51c1f191e1d52c3d1a752a02ef Mon Sep 17 00:00:00 2001 From: Cao Manh Dat Date: Fri, 28 Jul 2017 23:05:32 +0700 Subject: [PATCH] SOLR-10397: Overseer.createAutoscalingTriggerIfNotExist() should log error instead of throwing SolrException --- .../src/java/org/apache/solr/cloud/Overseer.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/cloud/Overseer.java b/solr/core/src/java/org/apache/solr/cloud/Overseer.java index ca7a935fba9..9176324c980 100644 --- a/solr/core/src/java/org/apache/solr/cloud/Overseer.java +++ b/solr/core/src/java/org/apache/solr/cloud/Overseer.java @@ -599,11 +599,14 @@ public class Overseer implements Closeable { request.getContext().put("httpMethod", "POST"); request.setContentStreams(Collections.singleton(new ContentStreamBase.StringStream(dsl))); SolrQueryResponse response = new SolrQueryResponse(); - getZkController().getCoreContainer() - .getRequestHandler(AutoScalingHandler.HANDLER_PATH).handleRequest(request, response); - if (!"success".equals(response.getValues().get("result"))) { - throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, - "Failed when creating .auto_add_replicas trigger, return " + response); + try { + getZkController().getCoreContainer() + .getRequestHandler(AutoScalingHandler.HANDLER_PATH).handleRequest(request, response); + if (!"success".equals(response.getValues().get("result"))) { + log.error("Failed when creating .auto_add_replicas trigger, return {}",response); + } + } catch (Exception e) { + log.error("Failed when creating .auto_add_replicas trigger ", e); } } };