-
Notifications
You must be signed in to change notification settings - Fork 815
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
Fix Redispatch method of Redispatcher #6668
base: master
Are you sure you want to change the base?
Conversation
} | ||
} | ||
} | ||
|
||
func (r *redispatcherImpl) redispatchTasks(notification redispatchNotification) { | ||
func (r *redispatcherImpl) redispatchTasks() { |
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 the Redispatch()
function call this redispatchTasks()
? The logic looks similar except:
- Redispatch() caps it to targetSize
- redispatchTasks() updates item.redispatchTime
- redispatchTasks() updates timer gate
Are these differences intentional? Even if some of them are intentional, we can make those configurable and still have a single task redispatch function doing all this to avoid redundancy
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.
+1
if item.redispatchTime.After(now) { | ||
break | ||
} | ||
submitted, err := r.taskProcessor.TrySubmit(item.task) |
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.
so, I guess the plan for those tasks that couldn't be submitted is to rely on the redispatch timer?
The core semantic change - as I understand it - is that you're making a function that may fail to redispatch the tasks via the async loop, but then puts it in a in-memory queue for redispatch next tick?
that seems reasonble, but just making sure I'm following.
What changed?
Why?
How did you test it?
unit tests
Potential risks
Redispatcher might be broken
Release notes
Documentation Changes