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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Scheduler to Support Relay Chain Block Number Provider #6362
base: master
Are you sure you want to change the base?
Update Scheduler to Support Relay Chain Block Number Provider #6362
Changes from 2 commits
f8e5c63
455d765
762c816
86701cf
27d1fa1
c79900c
622805d
abbd346
844662e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why would not it work with
IncompleteSince
, without the blockQueue
?How we determine the
MaxScheduledBlocks
bound?With the
IncompleteSince
we iterate over blocks that might have no task to execute and this might make a situation with many incomplete blocks even worth. But probably not too much? One more read?Both solutions need a strategy for a situation when there are two many tasks that can not be completed and the task queue only grow. If such strategy not yet in place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but then this becomes unbounded in case too many blocks are skipped. The idea behind using the
Queue
is to bound this to a sufficient number.This should be determined similar to the existing
MaxScheduledPerBlock
?There is already a retry mechanism and the task is purged if the retry count is exceeded (even if failed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
Queue
not only bounds how many blocks gonna be processed from the past. It bounds for how many blocks we can schedule. If the number is50
, we can schedule only50
jobs with distinct schedule time.The
MaxScheduledPerBlock
for me seems simpler to define. Because the block size its exiting constrain the system have. But how many distinct schedule time points you can have is something new.Retries work in case if a certain task fails while it's function call is being executed (not the scheduler fail). I meant a case when there are many (or few but too heavy) overdue tasks (task_block < now), so that the scheduler never (or needs too many time) to complete them and exist such overdue state to start processing tasks in time. Do we handle such case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I do not find it quite comfortable to run a
for
loop withIncompleteSince
when there could be an unknown number of blocks passed between the successive runs. You could always keep theMaxScheduledBlocks
on the higher side that would give you a similar experience?But this stays as an issue even in the current implementation? The change here just makes it bounded, so that the scheduling itself is blocked in such a case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can put a quite big bound on the
MaxScheduledBlocks
, it is just a vec of block numbers.