SOLR-17831: Fix the bug in QueryLimits initialization in SolrIndexSearcher.#3446
SOLR-17831: Fix the bug in QueryLimits initialization in SolrIndexSearcher.#3446sigram merged 7 commits intoapache:mainfrom
Conversation
Improve the helper class to better track locations and counts where limits are enforced.
Create a unit test to verify the use of ExitableDirectoryReader.
dsmiley
left a comment
There was a problem hiding this comment.
that's some impressive testing... I didn't know we had the ability to assert who exactly tripped the limit.
| throws IOException { | ||
| QueryLimits queryLimits = QueryLimits.getCurrentLimits(); | ||
| if (useExitableDirectoryReader || !queryLimits.isLimitsEnabled()) { | ||
| if (EnvUtils.getPropertyAsBool(EXITABLE_READER_PROPERTY) || !queryLimits.isLimitsEnabled()) { |
There was a problem hiding this comment.
should this instead check if the existing reader is an instance of ExitableDirectoryReader? It would have already been wrapped.
There was a problem hiding this comment.
I wonder in what scenario this would happen, realistically ... and whether we should care here. We need to make sure that the way we wrapped the original reader uses our implementation of the QueryTimeout. We have no way to determine that if the input is an EDR of unknown origin.
|
The helper class |
Improve the helper class to better track locations and counts where limits are enforced.
https://issues.apache.org/jira/browse/SOLR-17831
This PR will also improve testability of using ExitableDirectoryReader by better instrumentation in CallerSpecificQueryLimit and making the sysproperty modifiable by using EnvUtils.