Skip to content

Commit

Permalink
Deadlock in matching engine (#909)
Browse files Browse the repository at this point in the history
Looks like we never release the write lock if creating the new tasklist
fails.  Previously this code can never return error but now it does a
domain reverse lookup for domain name and could fail if domainCache
lookup fails.
  • Loading branch information
samarabbas authored and wxing1292 committed Jun 28, 2018
1 parent ce946a7 commit 308cfc0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion service/matching/matchingEngine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 308cfc0

Please sign in to comment.