majin1102 commented on code in PR #2790:
URL: https://github.com/apache/amoro/pull/2790#discussion_r1593649864
##########
amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/optimizing/TaskRuntime.java:
##########
@@ -105,6 +105,7 @@ public void complete(OptimizerThread thread,
OptimizingTaskResult result) {
token = null;
threadId = -1;
});
+ owner.releaseResourcesIfNecessary();
Review Comment:
> I think two threads are blocked inside `cancelTasks` within
`owner.acceptResult(this)`, so wrapping `cancelTask` within
`releaseResourcesIfNecessary` and placing it outside `owner.acceptResult(this)`
should indeed solve the deadlock issue
Sorry for late replying.
Just like @rfyu said, place canceling All Tasks out of task and process lock
could prevent all lock conflict cases involving canceling all tasks.
When two threads steping into owner.acceptResult(), one will wait for lock
anyway, I don't quite get your question
--
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]