Details
Description
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:
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 }
sortFieldValues can apparently be null in some cases, depending on when the query hits the timeAllowed. Adding an extra null check fixes the issue.
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 }
I'll attach a patch.
Attachments
Attachments
Issue Links
- is cloned by
-
SOLR-14674 NPE when TimeAllowed exceeded with sorting
- Closed
- relates to
-
SOLR-9882 exceeding timeAllowed causes ClassCastException: BasicResultContext cannot be cast to SolrDocumentList
- Closed
-
SOLR-14413 allow timeAllowed and cursorMark parameters
- Closed
- links to