You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/09/19 17:30:14 UTC

[GitHub] [solr] risdenk opened a new pull request, #1025: SOLR-16417: NPE if facet query hits timeout or exception

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

   https://issues.apache.org/jira/browse/SOLR-16417
   
   * Extracts method from already implemented logic to apply error checking for refine facets and distrib intervals. 
   * Use constants instead of strings in common cases.
   
   I didn't add a test for this since I couldn't get it to reproduce easily. I know its a condition of timeAllowed for what I saw this error happen. The issue is that timeAllowed isn't easy to insert into the running query at a predetermined interval. Most of the time this just ends up breaking out at some random time in the query.


-- 
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


[GitHub] [solr] risdenk commented on a diff in pull request #1025: SOLR-16417: NPE if facet query hits timeout or exception

Posted by GitBox <gi...@apache.org>.
risdenk commented on code in PR #1025:
URL: https://github.com/apache/solr/pull/1025#discussion_r974529403


##########
solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java:
##########
@@ -862,6 +839,42 @@ private void countFacets(ResponseBuilder rb, ShardRequest sreq) {
     removeQueryFacetsUnderLimits(rb);
   }
 
+  private static NamedList<?> getFacetCountsFromShardResponse(
+      ResponseBuilder rb, ShardResponse srsp) {
+    NamedList<?> facet_counts;
+    try {
+      SolrResponse solrResponse = srsp.getSolrResponse();
+      NamedList<Object> response = solrResponse.getResponse();
+      facet_counts = (NamedList<?>) response.get(FACET_COUNTS_KEY);
+      if (facet_counts != null) {
+        return facet_counts;
+      } else {
+        NamedList<?> responseHeader =
+            (NamedList<?>) response.get(SolrQueryResponse.RESPONSE_HEADER_KEY);
+        if (responseHeader.getBooleanArg(SolrQueryResponse.RESPONSE_HEADER_PARTIAL_RESULTS_KEY)) {
+          return null;
+        } else {
+          log.warn("corrupted response on {} : {}", srsp.getShardRequest(), solrResponse);
+          throw new SolrException(
+              ErrorCode.SERVER_ERROR,
+              FACET_COUNTS_KEY
+                  + " is absent in response from "
+                  + srsp.getNodeName()
+                  + ", but "
+                  + SolrQueryResponse.RESPONSE_HEADER_PARTIAL_RESULTS_KEY
+                  + " hasn't been responded");

Review Comment:
   Updated to `" isn't set in the response."`



-- 
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


[GitHub] [solr] risdenk merged pull request #1025: SOLR-16417: NPE if facet query hits timeout or exception

Posted by GitBox <gi...@apache.org>.
risdenk merged PR #1025:
URL: https://github.com/apache/solr/pull/1025


-- 
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


[GitHub] [solr] epugh commented on a diff in pull request #1025: SOLR-16417: NPE if facet query hits timeout or exception

Posted by GitBox <gi...@apache.org>.
epugh commented on code in PR #1025:
URL: https://github.com/apache/solr/pull/1025#discussion_r974524263


##########
solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java:
##########
@@ -862,6 +839,42 @@ private void countFacets(ResponseBuilder rb, ShardRequest sreq) {
     removeQueryFacetsUnderLimits(rb);
   }
 
+  private static NamedList<?> getFacetCountsFromShardResponse(
+      ResponseBuilder rb, ShardResponse srsp) {
+    NamedList<?> facet_counts;
+    try {
+      SolrResponse solrResponse = srsp.getSolrResponse();
+      NamedList<Object> response = solrResponse.getResponse();
+      facet_counts = (NamedList<?>) response.get(FACET_COUNTS_KEY);
+      if (facet_counts != null) {
+        return facet_counts;
+      } else {
+        NamedList<?> responseHeader =
+            (NamedList<?>) response.get(SolrQueryResponse.RESPONSE_HEADER_KEY);
+        if (responseHeader.getBooleanArg(SolrQueryResponse.RESPONSE_HEADER_PARTIAL_RESULTS_KEY)) {
+          return null;
+        } else {
+          log.warn("corrupted response on {} : {}", srsp.getShardRequest(), solrResponse);
+          throw new SolrException(
+              ErrorCode.SERVER_ERROR,
+              FACET_COUNTS_KEY
+                  + " is absent in response from "
+                  + srsp.getNodeName()
+                  + ", but "
+                  + SolrQueryResponse.RESPONSE_HEADER_PARTIAL_RESULTS_KEY
+                  + " hasn't been responded");

Review Comment:
   wording??   `hasn't responded` maybe?  Trying to figure out the wording!



-- 
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