majin1102 commented on issue #2623:
URL: https://github.com/apache/amoro/issues/2623#issuecomment-2072127755

   Hey, guys.
   
   The current fix is not completed because the code below:
   
   ```
     public void complete(OptimizerThread thread, OptimizingTaskResult result) {
       invokeConsistency(
           () -> {
             validThread(thread);
             if (result.getErrorMessage() != null) {
                 ......
             } else {
                 ......
             }
             runTimes += 1;
             persistTaskRuntime(this);
             owner.acceptResult(this);
             token = null;
             threadId = -1;
           });
     }
   
    void tryCanceling() {
       invokeConsistency(
           () -> {
             if (statusMachine.tryAccepting(Status.CANCELED)) {
               endTime = System.currentTimeMillis();
               if (startTime != ArcticServiceConstants.INVALID_TIME) {
                 costTime += endTime - startTime;
               }
               persistTaskRuntime(this);
             }
           });
     }
   ```
   
   when t1 failed, it would call t2.tryCancel, and when t2 failed, it would 
call t1.tryCancel,that's a new type of deadlock between taskRuntimes which is 
different from the situation between process and task.
   
   I think a proper way is to pull owner.acceptResult() out of 
invokeConsistency, which I think quite reasonable.


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to