You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Bram Van Dam <br...@intix.eu> on 2020/08/19 13:48:44 UTC
timeAllowed NPE and possible patch
Hey folks,
I would occasionally bump into an NPE in QueryComponent.mergeIds when
using timeAllowed. Here's a little patch which seems to fix the issue. I
suspect sortFieldValues can be null depending on when the query
execution is aborted?
- Bram
diff --git
a/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
b/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
index 853da1c3a38..c7e7c1e6b86 100644
---
a/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
+++
b/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
@@ -932,7 +932,7 @@ public class QueryComponent extends SearchComponent
@SuppressWarnings({"rawtypes"})
NamedList sortFieldValues =
(NamedList)(srsp.getSolrResponse().getResponse().get("sort_values"));
- if (sortFieldValues.size()==0 && // we bypass merging this
response only if it's partial itself
+ 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
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: timeAllowed NPE and possible patch
Posted by Bram Van Dam <br...@intix.eu>.
On 19/08/2020 16:11, David Smiley wrote:
> Please file a JIRA issue. Also mention which version of JIRA you use
> for the "Affects version".
Thanks. Created https://issues.apache.org/jira/browse/SOLR-14758 and
added a patch.
- Bram
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: timeAllowed NPE and possible patch
Posted by David Smiley <ds...@apache.org>.
Please file a JIRA issue. Also mention which version of JIRA you use for
the "Affects version".
~ David Smiley
Apache Lucene/Solr Search Developer
http://www.linkedin.com/in/davidwsmiley
On Wed, Aug 19, 2020 at 9:49 AM Bram Van Dam <br...@intix.eu> wrote:
> Hey folks,
>
> I would occasionally bump into an NPE in QueryComponent.mergeIds when
> using timeAllowed. Here's a little patch which seems to fix the issue. I
> suspect sortFieldValues can be null depending on when the query
> execution is aborted?
>
> - Bram
>
> diff --git
> a/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
> b/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
> index 853da1c3a38..c7e7c1e6b86 100644
> ---
> a/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
> +++
> b/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
> @@ -932,7 +932,7 @@ public class QueryComponent extends SearchComponent
>
> @SuppressWarnings({"rawtypes"})
> NamedList sortFieldValues =
> (NamedList)(srsp.getSolrResponse().getResponse().get("sort_values"));
> - if (sortFieldValues.size()==0 && // we bypass merging this
> response only if it's partial itself
> + 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
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>