While we were catching `TaskCancelledException` while we wait for reindexing to complete, we missed the fact that this exception may be wrapped in a multi-node cluster. This is the reason we may still fail the task when stop is called while reindexing. Some times we're lucky and the exception is thrown by the same node that runs the job. Then the exception is not wrapped and things work fine. But when that is not the case the exception is wrapped, we fail to catch it, and set the task to failed. The fix is to simply unwrap the exception when we check it it is `TaskCancelledException`. Closes #55068 Backport of #55659
This commit is contained in:
parent
8669766a81
commit
4b11adf074
|
@ -225,7 +225,7 @@ public class DataFrameAnalyticsManager {
|
|||
startAnalytics(task, config);
|
||||
},
|
||||
error -> {
|
||||
if (error instanceof TaskCancelledException && task.isStopping()) {
|
||||
if (ExceptionsHelper.unwrapCause(error) instanceof TaskCancelledException && task.isStopping()) {
|
||||
LOGGER.debug(new ParameterizedMessage("[{}] Caught task cancelled exception while task is stopping",
|
||||
config.getId()), error);
|
||||
task.markAsCompleted();
|
||||
|
|
Loading…
Reference in New Issue