ruanwenjun commented on a change in pull request #5572:
URL: https://github.com/apache/dolphinscheduler/pull/5572#discussion_r644846544
##########
File path:
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/cache/impl/TaskInstanceCacheManagerImpl.java
##########
@@ -57,7 +86,7 @@
@Override
public TaskInstance getByTaskInstanceId(Integer taskInstanceId) {
TaskInstance taskInstance = taskInstanceCache.get(taskInstanceId);
Review comment:
@blackberrier
> the block may happen on two thread on two key, and the two key share the
same hashcode
Yes, but we can avoid the 1 step.
```
1. taskInstance = processService.findTaskInstanceById(taskInstanceId);
2. TaskInstance finalTaskInstance = taskInstance;
3. taskInstanceCache.computeIfAbsent(taskInstanceId, k -> finalTaskInstance);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]