[ https://issues.apache.org/jira/browse/LUCENE-10544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17536624#comment-17536624 ]
Deepika Sharma commented on LUCENE-10544: ----------------------------------------- I am currently working on wrapping postings/impacts with {{ExitableTermsEnum}} in {{{}ExitableDirectoryReader{}}}. I am looking suggestion for unit test regarding this. More context regarding the approach I have done is: To wrap postings/impacts with {{{}ExitableTermsEnum{}}}, I tried overriding other methods of {{FilterTermsEnum}} with timeout check in {{ExitableTermsEnum}} along with already overridden {{next()}} method. Also, {{PostingsEnum}} and {{ImpactsEnum}} needs to be wrapped. So, for this I created {{ExitableImpactsEnum }}extended from {{ImpactsEnum}} and similarly {{ExitablePostingsEnum}} extended from {{PostingsEnum}} in {{ExitableDirectoryReader}} class where all the methods of the respective classes are overridden along with timeout checks. Also, modified {{ExitableTermsEnum}} such that when {{#impacts(...)}} is invoked then we return instance of {{{}ExitableImpactsEnum{}}}. Similarly, when {{#postings(...)}} is invoked then we return instance of {{{}ExitablePostingsEnum{}}}. It was observed that for {{ExitableImpactsEnum}} and {{ExitablePostingsEnum}} are getting invoked through {{#scoreAll}} for {{TermQuery}} and {{PrefixQuery}} respectively. One problem that I have observed is, for any particular timeout value the no. of results are not fixed. For example, I tried running the test with timeout value 100 and I got all the results, but at some subsequent running of test with same timeout value I received 0, 3, and 5 (different number) results > Should ExitableTermsEnum wrap postings and impacts? > --------------------------------------------------- > > Key: LUCENE-10544 > URL: https://issues.apache.org/jira/browse/LUCENE-10544 > Project: Lucene - Core > Issue Type: Bug > Components: core/index > Reporter: Greg Miller > Priority: Major > > While looking into options for LUCENE-10151, I noticed that > {{ExitableDirectoryReader}} doesn't actually do any timeout checking once you > start iterating postings/impacts. It *does* create a {{ExitableTermsEnum}} > wrapper when loading a {{{}TermsEnum{}}}, but that wrapper doesn't do > anything to wrap postings or impacts. So timeouts will be enforced when > moving to the "next" term, but not when iterating the postings/impacts > associated with a term. > I think we ought to wrap the postings/impacts as well with some form of > timeout checking so timeouts can be enforced on long-running queries. I'm not > sure why this wasn't done originally (back in 2014), but it was questioned > back in 2020 on the original Jira SOLR-5986. Does anyone know of a good > reason why we shouldn't enforce timeouts in this way? > Related, we may also want to wrap things like {{seekExact}} and {{seekCeil}} > given that only {{next}} is being wrapped currently. -- This message was sent by Atlassian Jira (v8.20.7#820007) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org