-
Notifications
You must be signed in to change notification settings - Fork 805
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 check idle tasklist to include active task writers #916
Conversation
service/matching/taskListManager.go
Outdated
@@ -338,6 +343,7 @@ func (c *taskListManagerImpl) Start() error { | |||
c.taskWriter.Start() | |||
c.signalNewTask() | |||
go c.getTasksPump() | |||
go c.checkIdle() |
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.
Why do we need a separate goroutine for idle check? why can't be done in the same pump like we do for zero pollers check?
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.
Changed, previously because I try to avoid this check potentially block getTaskPump
service/matching/taskListManager.go
Outdated
@@ -949,3 +969,16 @@ func (c *taskContext) completeTask(err error) { | |||
func createServiceBusyError(msg string) *s.ServiceBusyError { | |||
return &s.ServiceBusyError{Message: msg} | |||
} | |||
|
|||
func (c *taskListManagerImpl) updateLastAddTaskTime() { | |||
c.lastAddTaskTimeLock.Lock() |
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.
I think we should do this without adding another lock.
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.
Update with better solution in getTaskPump
service/matching/taskListManager.go
Outdated
@@ -51,6 +51,8 @@ const ( | |||
const ( | |||
_defaultTaskDispatchRPS = 100000.0 | |||
_defaultTaskDispatchRPSTTL = 60 * time.Second | |||
|
|||
maxAddTasksIdleTime = 5 * time.Minute |
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 convert this to a config knob.
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.
Done
Currently in matching getTaskPump there is a timer to check whether tasklist is "idle" and need to recycle. But it only treat no poller within 5 min as idle to recycle.
This PR add check idle to include if there are tasks added recently (5 min).
The default live time it currently hardcoded as 5 min for both poller and writer. Which can be make configurable if necessary.