From 288c520881d551ca49493866f97bdc48fe7140a9 Mon Sep 17 00:00:00 2001 From: Nick Ginther Date: Mon, 28 Nov 2022 12:05:14 -0600 Subject: [PATCH 1/3] Print warning log when exception is thrown for shard request/response --- .../java/org/apache/solr/handler/component/SearchHandler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java index d670ed954ad..f06e4b3a666 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java @@ -536,6 +536,7 @@ public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throw // Was there an exception? if (srsp.getException() != null) { + log.warn("Shard request failed : " + srsp.getException().getMessage(), srsp.getException()); // If things are not tolerant, abort everything and rethrow if (!tolerant) { shardHandler1.cancelAll(); From 53267c20190c76400cfa387415112632126d4ab5 Mon Sep 17 00:00:00 2001 From: Nick Ginther Date: Mon, 28 Nov 2022 13:04:19 -0600 Subject: [PATCH 2/3] run gradle tidy --- .../java/org/apache/solr/handler/component/SearchHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java index f06e4b3a666..66fd962f434 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java @@ -536,7 +536,9 @@ public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throw // Was there an exception? if (srsp.getException() != null) { - log.warn("Shard request failed : " + srsp.getException().getMessage(), srsp.getException()); + log.warn( + "Shard request failed : " + srsp.getException().getMessage(), + srsp.getException()); // If things are not tolerant, abort everything and rethrow if (!tolerant) { shardHandler1.cancelAll(); From 05ac83062c104478f99b50c794bdf095946db4dd Mon Sep 17 00:00:00 2001 From: Nick Ginther Date: Mon, 28 Nov 2022 14:13:10 -0600 Subject: [PATCH 3/3] make log less expensive + in line with gradle log check --- .../java/org/apache/solr/handler/component/SearchHandler.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java index 66fd962f434..ef99cbb400b 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java @@ -536,9 +536,7 @@ public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throw // Was there an exception? if (srsp.getException() != null) { - log.warn( - "Shard request failed : " + srsp.getException().getMessage(), - srsp.getException()); + log.warn("Shard request failed : {}", srsp); // If things are not tolerant, abort everything and rethrow if (!tolerant) { shardHandler1.cancelAll();