diff --git a/service/matching/matchingEngine.go b/service/matching/matchingEngine.go index bb478f7f22f..c40fc9d64d1 100644 --- a/service/matching/matchingEngine.go +++ b/service/matching/matchingEngine.go @@ -179,13 +179,15 @@ func (e *matchingEngineImpl) getTaskListManager(taskList *taskListID, e.taskListsLock.Unlock() return result, nil } + logging.LogTaskListLoadingEvent(e.logger, taskList.taskListName, taskList.taskType) mgr, err := newTaskListManager(e, taskList, taskListKind, e.config) if err != nil { + e.taskListsLock.Unlock() + logging.LogTaskListLoadingFailedEvent(e.logger, taskList.taskListName, taskList.taskType, err) return nil, err } e.taskLists[*taskList] = mgr e.taskListsLock.Unlock() - logging.LogTaskListLoadingEvent(e.logger, taskList.taskListName, taskList.taskType) err = mgr.Start() if err != nil { logging.LogTaskListLoadingFailedEvent(e.logger, taskList.taskListName, taskList.taskType, err)