You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "renatoh (via GitHub)" <gi...@apache.org> on 2023/10/26 20:06:39 UTC

[PR] Extract duplicate code and move it to CollectionHandlingUtils [solr]

renatoh opened a new pull request, #2044:
URL: https://github.com/apache/solr/pull/2044

   I came across some duplicate code which I moved to the utils-class


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] Extract duplicate code and move it to CollectionHandlingUtils [solr]

Posted by "renatoh (via GitHub)" <gi...@apache.org>.
renatoh commented on PR #2044:
URL: https://github.com/apache/solr/pull/2044#issuecomment-1786687021

   @risdenk  Hey Kevin, would you mind having a look at this PR? thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] Extract duplicate code and move it to CollectionHandlingUtils [solr]

Posted by "renatoh (via GitHub)" <gi...@apache.org>.
renatoh commented on code in PR #2044:
URL: https://github.com/apache/solr/pull/2044#discussion_r1402482842


##########
solr/core/src/java/org/apache/solr/cloud/api/collections/CollectionHandlingUtils.java:
##########
@@ -450,6 +450,26 @@ static void processResponse(
     }
   }
 
+  static void logFailedOperation(final Object operation, final Exception e, final String collName) {
+    if (collName == null) {
+      log.error("Operation {} failed", operation, e);
+    } else {
+      log.error("Collection {}}, operation {} failed", collName, operation, e);

Review Comment:
   To my defense, this was already within the original code, I extracted it to a method without noticing the issue, good catch!



##########
solr/core/src/java/org/apache/solr/cloud/OverseerConfigSetMessageHandler.java:
##########
@@ -98,6 +99,8 @@ public OverseerSolrResponse processMessage(ZkNodeProps message, String operation
         log.error("ConfigSet: {} operation: {} failed", configSetName, operation, e);
       }
 
+      addExceptionToNamedList(operation, e, results);
+
       results.add("Operation " + operation + " caused exception:", e);

Review Comment:
   Nope, I had forgotten to remove the original code in this instance. I did remove it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] Extract duplicate code and move it to CollectionHandlingUtils [solr]

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh commented on code in PR #2044:
URL: https://github.com/apache/solr/pull/2044#discussion_r1402161824


##########
solr/core/src/java/org/apache/solr/cloud/OverseerConfigSetMessageHandler.java:
##########
@@ -98,6 +99,8 @@ public OverseerSolrResponse processMessage(ZkNodeProps message, String operation
         log.error("ConfigSet: {} operation: {} failed", configSetName, operation, e);
       }
 
+      addExceptionToNamedList(operation, e, results);
+
       results.add("Operation " + operation + " caused exception:", e);

Review Comment:
   Do we still need this after adding the `addExceptionToNamedList` call?



##########
solr/core/src/java/org/apache/solr/cloud/api/collections/CollectionHandlingUtils.java:
##########
@@ -450,6 +450,26 @@ static void processResponse(
     }
   }
 
+  static void logFailedOperation(final Object operation, final Exception e, final String collName) {
+    if (collName == null) {
+      log.error("Operation {} failed", operation, e);
+    } else {
+      log.error("Collection {}}, operation {} failed", collName, operation, e);

Review Comment:
   should `}}` be just `}`???



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] Extract duplicate code and move it to CollectionHandlingUtils [solr]

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh merged PR #2044:
URL: https://github.com/apache/solr/pull/2044


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] Extract duplicate code and move it to CollectionHandlingUtils [solr]

Posted by "renatoh (via GitHub)" <gi...@apache.org>.
renatoh commented on PR #2044:
URL: https://github.com/apache/solr/pull/2044#issuecomment-1822838682

   @epugh Hey Eric
   This PR has been open for quite a while. Would you mind having a look at it?, Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org