mirror of
https://github.com/apache/druid.git
synced 2025-02-25 12:35:33 +00:00
Add wait for worker shutdown to MSQ task cancel (#14198)
* Add wait for worker shutdown to MSQ task cancel * Fix checkstyle
This commit is contained in:
parent
123c4908c8
commit
fb38085ddb
@ -355,6 +355,8 @@ public class ControllerImpl implements Controller
|
||||
throw new MSQException(CanceledFault.INSTANCE);
|
||||
}
|
||||
);
|
||||
|
||||
workerTaskLauncher.waitForWorkerShutdown();
|
||||
}
|
||||
|
||||
public TaskStatus runTask(final Closer closer)
|
||||
|
@ -205,12 +205,7 @@ public class MSQWorkerTaskLauncher
|
||||
}
|
||||
|
||||
// Block until stopped.
|
||||
try {
|
||||
FutureUtils.getUnchecked(stopFuture, false);
|
||||
}
|
||||
catch (Throwable ignored) {
|
||||
// Suppress.
|
||||
}
|
||||
waitForWorkerShutdown();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -309,6 +304,15 @@ public class MSQWorkerTaskLauncher
|
||||
}
|
||||
}
|
||||
|
||||
public void waitForWorkerShutdown()
|
||||
{
|
||||
try {
|
||||
FutureUtils.getUnchecked(stopFuture, false);
|
||||
}
|
||||
catch (Throwable ignored) {
|
||||
// Suppress.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the controller has canceled the input taskId. This method is used in {@link ControllerImpl}
|
||||
|
Loading…
x
Reference in New Issue
Block a user