You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by tf...@apache.org on 2018/09/14 03:50:18 UTC

lucene-solr:branch_7_5: SOLR-12766: Log retries after the backoff

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7_5 f5b00707a -> 3b3d27574


SOLR-12766: Log retries after the backoff


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/3b3d2757
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/3b3d2757
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/3b3d2757

Branch: refs/heads/branch_7_5
Commit: 3b3d27574c424d5fccb6172dfa8f99584c41e56b
Parents: f5b0070
Author: Tomas Fernandez Lobbe <tf...@apache.org>
Authored: Thu Sep 13 20:46:38 2018 -0700
Committer: Tomas Fernandez Lobbe <tf...@apache.org>
Committed: Thu Sep 13 20:50:09 2018 -0700

----------------------------------------------------------------------
 .../apache/solr/update/SolrCmdDistributor.java  | 29 +++++++++-----------
 1 file changed, 13 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3b3d2757/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
index d7388f0..cb7f9cb 100644
--- a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
+++ b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
@@ -129,8 +129,6 @@ public class SolrCmdDistributor implements Closeable {
 
     for (Error err : errors) {
       try {
-        String oldNodeUrl = err.req.node.getUrl();
-        
         /*
          * if this is a retryable request we may want to retry, depending on the error we received and
          * the number of times we have already retried
@@ -143,20 +141,6 @@ public class SolrCmdDistributor implements Closeable {
         // this can happen in certain situations such as close
         if (isRetry) {
           err.req.retries++;
-
-          if (err.req.node instanceof ForwardNode) {
-            SolrException.log(SolrCmdDistributor.log, "forwarding update to "
-                + oldNodeUrl + " failed - retrying ... retries: "
-                + err.req.retries + "/" + err.req.node.getMaxRetries() + ". "
-                + err.req.cmd.toString() + " params:"
-                + err.req.uReq.getParams() + " rsp:" + err.statusCode, err.e);
-          } else {
-            SolrException.log(SolrCmdDistributor.log, "FROMLEADER request to "
-                + oldNodeUrl + " failed - retrying ... retries: "
-                + err.req.retries + "/" + err.req.node.getMaxRetries() + ". "
-                + err.req.cmd.toString() + " params:"
-                + err.req.uReq.getParams() + " rsp:" + err.statusCode, err.e);
-          }
           resubmitList.add(err);
         } else {
           allErrors.add(err);
@@ -182,6 +166,19 @@ public class SolrCmdDistributor implements Closeable {
     clients.clearErrors();
     this.errors.clear();
     for (Error err : resubmitList) {
+      if (err.req.node instanceof ForwardNode) {
+        SolrException.log(SolrCmdDistributor.log, "forwarding update to "
+            + err.req.node.getUrl() + " failed - retrying ... retries: "
+            + err.req.retries + "/" + err.req.node.getMaxRetries() + ". "
+            + err.req.cmd.toString() + " params:"
+            + err.req.uReq.getParams() + " rsp:" + err.statusCode, err.e);
+      } else {
+        SolrException.log(SolrCmdDistributor.log, "FROMLEADER request to "
+            + err.req.node.getUrl() + " failed - retrying ... retries: "
+            + err.req.retries + "/" + err.req.node.getMaxRetries() + ". "
+            + err.req.cmd.toString() + " params:"
+            + err.req.uReq.getParams() + " rsp:" + err.statusCode, err.e);
+      }
       submit(err.req, false);
     }