Add ability to limit how many handlers are processed#114
Merged
jaredlewis merged 11 commits intoambitioninc:developfrom Mar 14, 2025
Merged
Add ability to limit how many handlers are processed#114jaredlewis merged 11 commits intoambitioninc:developfrom
jaredlewis merged 11 commits intoambitioninc:developfrom
Conversation
wesleykendall
approved these changes
Mar 12, 2025
wesleykendall
left a comment
There was a problem hiding this comment.
I think I see your general strategy here and it lgtm.
Do we actually use this rrule module anywhere outside Ambition? I dont see it in Houston or Data. There are already docs in Ambitions repo about this module too.
probably best to eventually consolidate this one too
Contributor
Author
|
i think its used in houston but only for the lock which can be replaced with pglock very easily |
thinkt4nk
reviewed
Mar 12, 2025
| order_by=F('next_occurrence').asc() | ||
| ) | ||
| ).filter( | ||
| row_num=1 |
Contributor
There was a problem hiding this comment.
so this is the part that restricts the rrule handler from processing more than one recurrence type in a single tick?
Contributor
Author
There was a problem hiding this comment.
this just ensures proper ordering in the event we are running with a limit, we want to prioritize a handler that has the most out of date occurrence
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.
Since we have so many instances using rrule now, the single task handler is timing out trying to process all handlers within the same transaction. This will give us the ability to limit how many instances are being processed at once and give us the ability to create tasks that will process much smaller bathes of recurrences.
This is not an ideal fix and would like to revisit this to propose a better more robust solution, but this is necessary given our current state.