You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Uwe Schindler (Jira)" <ji...@apache.org> on 2021/08/07 11:26:00 UTC

[jira] [Commented] (SOLR-14758) NPE in QueryComponent.mergeIds when using timeAllowed and sorting

    [ https://issues.apache.org/jira/browse/SOLR-14758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17395196#comment-17395196 ] 

Uwe Schindler commented on SOLR-14758:
--------------------------------------

Hi,
I have seen this also at one of my customers. In my opinion, the problem is not severe, as it only happens when a query timeouts, so the use won't get results anyways, or do I miss something. The only thing that would break are partial results.

IMHO, when I looked at the issue, I would have said: add a null check, nothing bad can happen.

Should I merge that patch?
Uwe

> NPE in QueryComponent.mergeIds when using timeAllowed and sorting
> -----------------------------------------------------------------
>
>                 Key: SOLR-14758
>                 URL: https://issues.apache.org/jira/browse/SOLR-14758
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrCloud
>    Affects Versions: 7.7.3, main (9.0)
>            Reporter: Bram Van Dam
>            Priority: Major
>         Attachments: SOLR-14758.patch, SOLR-14758.patch
>
>
> Only tested on 7.7.3 and master, but the offending code hasn't been changed for a while, so this presumably affects other versions as well. 
> Steps to reproduce:
> # SolrCloud
> # Create a query which is complex enough to take a while
> # Add a sort clause to the query (e.g. &sort=creationTimestamp asc)
> # Add a short value timeAllowed (10ms in my test)
> Result: NPE in QueryComponent.mergeIds:935
> It may take a couple of attempts to hit the error.
> Offending code:
> {code:java}
>         NamedList sortFieldValues = (NamedList)(srsp.getSolrResponse().getResponse().get("sort_values"));
>         if (sortFieldValues.size()==0 && // we bypass merging this response only if it's partial itself
>                             thisResponseIsPartial) { // but not the previous one!!
>           continue; //fsv timeout yields empty sort_vlaues
>         }
> {code}
> sortFieldValues can apparently be null in some cases, depending on when the query hits the timeAllowed. Adding an extra null check fixes the issue.
> {code:java}
>         NamedList sortFieldValues = (NamedList)(srsp.getSolrResponse().getResponse().get("sort_values"));
>         if ((null == sortFieldValues || sortFieldValues.size()==0) && // we bypass merging this response only if it's partial itself
>                             thisResponseIsPartial) { // but not the previous one!!
>           continue; //fsv timeout yields empty sort_vlaues
>         }
> {code}
> I'll attach a patch.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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