[cherry-pick-2.0.1][Bug-7307][MasterServer] timeout event was filtered (#7303)

* remove task filter when task timeout

* get lastest task instance info

Co-authored-by: caishunfeng <534328519@qq.com>
This commit is contained in:
wind 2021-12-10 12:04:40 +08:00 committed by GitHub
parent 7ec4cb9dc3
commit 5dad635ff0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 6 deletions

View File

@ -317,14 +317,14 @@ public class WorkflowExecuteThread implements Runnable {
private boolean taskTimeout(StateEvent stateEvent) {
if (taskInstanceHashMap.containsRow(stateEvent.getTaskInstanceId())) {
if (!taskInstanceHashMap.containsRow(stateEvent.getTaskInstanceId())) {
return true;
}
TaskInstance taskInstance = taskInstanceHashMap
.row(stateEvent.getTaskInstanceId())
.values()
.iterator().next();
// get lastest task instance into
TaskInstance taskInstance = processService.findTaskInstanceById(stateEvent.getTaskInstanceId());
TaskDefinition taskDefinition = processService.findTaskDefinition(taskInstance.getTaskCode(), taskInstance.getTaskDefinitionVersion());
taskInstance.setTaskDefine(taskDefinition);
if (TimeoutFlag.CLOSE == taskInstance.getTaskDefine().getTimeoutFlag()) {
return true;
@ -704,7 +704,6 @@ public class WorkflowExecuteThread implements Runnable {
}
}
/**
* find task instance in db.
* in case submit more than one same name task in the same time.