285
// lock and call addNewTasks. We call addTaskToMatcher outside tr.lock since it may take other
286
// locks to redirect the task.
287
>
func (tr *priTaskReader) addNewTasks(tasks []*persistencespb.AllocatedTaskInfo) {
pri_task_reader.go
288
>
for _, t := range tasks {
289
>
task := newInternalTaskFromBacklog(t, tr.completeTask)
290
>
tr.backlogMgr.setPriority(task)
291
>
tr.addTaskToMatcher(task)
292
>
}
293
}
294
296
>
task.resetMatcherState()
297
>
err := tr.backlogMgr.addSpooledTask(task)
298
>
if err == nil {
299
>
return
300
>
}
301
302
if drop, retry := tr.addErrorBehavior(err); drop {