ruanwenjun commented on a change in pull request #5656:
URL: https://github.com/apache/dolphinscheduler/pull/5656#discussion_r655854496



##########
File path: 
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/cache/impl/TaskInstanceCacheManagerImpl.java
##########
@@ -110,6 +110,7 @@ public void cacheTaskInstance(TaskExecutionContext 
taskExecutionContext) {
     @Override
     public void cacheTaskInstance(TaskExecuteAckCommand taskAckCommand) {
         TaskInstance taskInstance = new TaskInstance();
+        taskInstance.setId(taskAckCommand.getTaskInstanceId());

Review comment:
       @wordhardqi Since we use ConcurrentHashMap here, can we direct use 
`computeIfPresent` method here?
   
   This method `cacheTaskInstance` is used to update status from worker 
response, and the task instance should already be cached in the map, so we 
don't need to considerate the absent case.




-- 
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]


Reply via email to