Repository navigation
Count the search limit per occurrence, not per query - #2
Merged
Merged
Conversation
The search budget counted every period of a query and was never reset. A plain iteration of a dense rule (FREQ=MINUTELY) threw SearchLimitExceededException after 1 000 000 occurrences. The engine now resets the budget when the query produces an occurrence. The limit bounds the search for one occurrence. An excluded candidate is not an occurrence, so a fully excluded set still reaches the limit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The search budget counts every period of a query and is never reset. A plain iteration of a dense rule fails:
foreachoverFREQ=MINUTELYthrowsSearchLimitExceededExceptionafter 1 000 000 occurrences (about 694 days).between()over two years of the same rule throws.withSearchLimit(10)->take(20)throws "examined 10 periods without reaching an answer" after it found 10 answers.Change
RecurrenceEngineresets the budget when the query produces an occurrence. The limit now bounds the search for one occurrence.EXRULEremoves fully still reaches the limit.