solr icon indicating copy to clipboard operation
solr copied to clipboard

SOLR-14607: LTR Query, the TimeAllowed parameter causes a timeout exception after no results

Open limingnihao opened this issue 4 years ago • 5 comments

Description

When timeAllowed parameter is set, the SolrQueryTimeoutImpl function will be started to detect whether it has timed out when the term is loaded. When overtime, an ExitingReaderException is thrown.

In the process of scoreFeatures of LTRQuery, ExitingReaderException will occur in two stages.


  • scorer: Occurs when a term needs to be loaded to the LeafReaderContext when creating Weight.
  • score: The term needs to be loaded when some functions call getValue. For example, FloatPayloadValueSource.

So it can be compatible with this ExitingReaderException, and partly return. At least it's better than empty.

Solution

In scoreFeatures method, catch ExitingReaderException and return the currently loaded document.

Tests

Simulation throws ExitingReaderException in the scorer process, and partially returns the loaded document.
Simulation throws ExitingReaderException in the score process of Feature, partially returning the calculated document.

Checklist

Please review the following and check all that apply:

  • [x] I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • [x] I have created a Jira issue and added the issue ID to my pull request title.
  • [x] I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • [x] I have developed this patch against the master branch.
  • [x] I have run ant precommit and the appropriate test suite.
  • [x] I have added tests for my changes.

limingnihao avatar Mar 11 '21 08:03 limingnihao

@cpoerschke I have resubmitted it. Please review this PR again, thanks.

limingnihao avatar Mar 11 '21 09:03 limingnihao

@alessandrobenedetti Add a parameter to LTR that lets the user choose what to do with the timeout? What do you think?

limingnihao avatar Mar 22 '21 05:03 limingnihao

@alessandrobenedetti Add a parameter to LTR that lets the user choose what to do with the timeout? What do you think?

mmm personally I don't think it is useful to have some results reranked and some not, depending on a time-out and with little control over knowing "up to what" was reranked. So, in my opinion, I would not add it as a parameter, it will just add unnecessary complexity.

alessandrobenedetti avatar Mar 22 '21 15:03 alessandrobenedetti

This PR had no visible activity in the past 60 days, labeling it as stale. Any new activity will remove the stale label. To attract more reviewers, please tag someone or notify the [email protected] mailing list. Thank you for your contribution!

github-actions[bot] avatar Feb 27 '24 00:02 github-actions[bot]

This PR had no visible activity in the past 60 days, labeling it as stale. Any new activity will remove the stale label. To attract more reviewers, please tag someone or notify the [email protected] mailing list. Thank you for your contribution!

github-actions[bot] avatar May 28 '24 00:05 github-actions[bot]