Skip to content

Conversation

@dnhatn
Copy link
Member

@dnhatn dnhatn commented Feb 26, 2025

  java.lang.AssertionError: org.elasticsearch.tasks.TaskCancelledException: task cancelled before starting [cancelled on failure]
        at __randomizedtesting.SeedInfo.seed([842AF61A97BFEAAA]:0)
        at org.elasticsearch.action.ActionListenerImplementations.expectNoException(ActionListenerImplementations.java:157)
        at org.elasticsearch.action.ActionListenerImplementations$DelegatingFailureActionListener.onResponse(ActionListenerImplementations.java:221)
        at org.elasticsearch.action.ActionListenerImplementations$MappedActionListener.onResponse(ActionListenerImplementations.java:97)
        at org.elasticsearch.action.ActionListenerResponseHandler.handleResponse(ActionListenerResponseHandler.java:49)
        at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleResponse(TransportService.java:1499)
        at org.elasticsearch.transport.InboundHandler.doHandleResponse(InboundHandler.java:434)
        at org.elasticsearch.transport.InboundHandler$2.doRun(InboundHandler.java:391)
        at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:27)
        at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:34)
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:1044)
        at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:27)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1575)
        Caused by:
        org.elasticsearch.tasks.TaskCancelledException: task cancelled before starting [cancelled on failure]
            at app//org.elasticsearch.tasks.TaskManager.registerCancellableTask(TaskManager.java:245)
            at app//org.elasticsearch.tasks.TaskManager.register(TaskManager.java:152)
            at app//org.elasticsearch.tasks.TaskManager.register(TaskManager.java:118)
            at app//org.elasticsearch.xpack.esql.plugin.ComputeService.createGroupTask(ComputeService.java:436)
            at app//org.elasticsearch.xpack.esql.plugin.ClusterComputeHandler.lambda$startComputeOnRemoteCluster$6(ClusterComputeHandler.java:112)
            at app//org.elasticsearch.action.ActionListenerImplementations$DelegatingFailureActionListener.onResponse(ActionListenerImplementations.java:219)
            ... 12 more

If the parent task is canceled, registering the compute group task might throw a TaskCancelledException, so the listener won't be notified.

Closes #123216
Closes #123101
Closes #123451

@dnhatn dnhatn added v8.19.0 >test Issues or PRs that are addressing/adding tests :Analytics/ES|QL AKA ESQL labels Feb 26, 2025
@dnhatn dnhatn requested a review from smalyshev February 26, 2025 02:08
@dnhatn dnhatn marked this pull request as ready for review February 26, 2025 02:08
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Feb 26, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@dnhatn dnhatn requested a review from quux00 March 3, 2025 06:58
@dnhatn dnhatn added the auto-backport Automatically create backport pull requests when merged label Mar 3, 2025
}

CancellableTask createGroupTask(Task parentTask, Supplier<String> description) {
CancellableTask createGroupTask(Task parentTask, Supplier<String> description) throws TaskCancelledException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't TaskCancelledException a runtime exception? So making it checked here doesn't do much except documenting the fact it may be thrown, am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's correct.

@dnhatn
Copy link
Member Author

dnhatn commented Mar 3, 2025

Thanks everyone!

@dnhatn dnhatn merged commit a320809 into elastic:main Mar 3, 2025
17 checks passed
@dnhatn dnhatn deleted the handle-exception-task branch March 3, 2025 16:00
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

dnhatn added a commit that referenced this pull request Mar 4, 2025
If the parent task is canceled, registering the compute group task might 
throw a TaskCancelledException, so the listener won't be notified.

Closes #123216
Closes #123101
Closes #123451
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests v8.19.0 v9.1.0

Projects

None yet

5 participants