[bugfix](deadlock) pipelinex map lock should only scope in map not about pipelinectx's cancel method (#32622)
both global lock in fragment mgr should only protect the map logic, could not use it to protect cancel method. fragment ctx cancel method should be protected by a lock. query ctx cancel --> pipelinex fragment cancel ---> query ctx cancel will dead lock.
This commit is contained in:
@ -3271,9 +3271,6 @@ public class Coordinator implements CoordInterface {
|
||||
// return true if cancel success. Otherwise, return false
|
||||
|
||||
private synchronized boolean cancelFragment(Types.PPlanFragmentCancelReason cancelReason) {
|
||||
if (!this.hasCanceled) {
|
||||
return false;
|
||||
}
|
||||
for (RuntimeProfile profile : taskProfile) {
|
||||
profile.setIsCancel(true);
|
||||
}
|
||||
@ -3288,6 +3285,7 @@ public class Coordinator implements CoordInterface {
|
||||
try {
|
||||
BackendServiceProxy.getInstance().cancelPipelineXPlanFragmentAsync(brpcAddress,
|
||||
this.fragmentId, queryId, cancelReason);
|
||||
this.hasCanceled = true;
|
||||
} catch (RpcException e) {
|
||||
LOG.warn("cancel plan fragment get a exception, address={}:{}", brpcAddress.getHostname(),
|
||||
brpcAddress.getPort());
|
||||
|
||||
Reference in New Issue
Block a user