From 8ab750f3f21402c8c78af9462d8fd128a577d4ed Mon Sep 17 00:00:00 2001 From: Markus Heiden Date: Thu, 18 Feb 2016 12:02:28 +0100 Subject: [PATCH] Do not log error messages, if client has been interrupted --- .../apache/solr/client/solrj/impl/CloudSolrClient.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java index 0973475e71ca..8f8311f625e8 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java @@ -897,11 +897,16 @@ protected NamedList requestWithRetryOnStaleState(SolrRequest request, in } } + if (rootCause instanceof InterruptedException) { + log.debug("Request to collection {} has been interrupted.", collection); + throw exc; + } + int errorCode = (rootCause instanceof SolrException) ? ((SolrException)rootCause).code() : SolrException.ErrorCode.UNKNOWN.code; - log.error("Request to collection {} failed due to ("+errorCode+ - ") {}, retry? "+retryCount, collection, rootCause.toString()); + log.error("Request to collection {} failed due to ({}) {}, retry? {}", + collection, errorCode, rootCause, retryCount); boolean wasCommError = (rootCause instanceof ConnectException ||