# Task cancelled warning message on elastic master node

**URL:** <https://discuss.elastic.co/t/task-cancelled-warning-message-on-elastic-master-node/304838>\
**Category:** Elasticsearch\
**Created:** [May 16, 2022, 3:08pm UTC](https://discuss.elastic.co/t/task-cancelled-warning-message-on-elastic-master-node/304838 "2022-05-16T15:08:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thuunder7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thuunder7/32/97482_2.png) [@Thuunder7](https://discuss.elastic.co/u/Thuunder7)\
**Post date:** [May 16, 2022, 3:08pm UTC](https://discuss.elastic.co/t/task-cancelled-warning-message-on-elastic-master-node/304838/1 "2022-05-16T15:08:09Z")

</div>

Hello guys,

My master node is printing the following warning message quite frequently:

```auto
[2022-05-16T16:03:39,712][WARN][r.suppressed] [loganshrdb03s] path: /_xpack/usage, params: {}
java.util.concurrent.CancellationException: Task cancelled
        at org.elasticsearch.xpack.core.action.TransportXPackUsageAction.lambda$masterOperation$2(TransportXPackUsageAction.java:83) ~[x-pack-core-7.16.2.jar:7.16.2]
        at org.elasticsearch.xpack.core.common.IteratingActionListener.onResponse(IteratingActionListener.java:135) [x-pack-core-7.16.2.jar:7.16.2]
        at org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:47) [elasticsearch-7.16.2.jar:7.16.2]
        at org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:62) [elasticsearch-7.16.2.jar:7.16.2]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:777) [elasticsearch-7.16.2.jar:7.16.2]
        at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) [elasticsearch-7.16.2.jar:7.16.2]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
        at java.lang.Thread.run(Thread.java:833) [?:?]

```

Does someone know what it means?

Regards,

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 16, 2022, 4:08pm UTC](https://discuss.elastic.co/t/task-cancelled-warning-message-on-elastic-master-node/304838/2 "2022-05-16T16:08:47Z")

</div>

This is a logging bug, these messages should only be reported at `DEBUG` level. This is fixed by the following PR:

> <https://github.com/elastic/elasticsearch/pull/86659>
>
> In #72157 we made it so that cancelling the task that a
> \`TransportMasterNodeAct…ion\` was executing causes the action to fail with
> a \`java.util.concurrent.CancellationException\`. This exception is
> treated as a \`500 Internal Server Error\` which results in \`WARN\`-level
> logs, but cancelling a task is normal and expected behaviour and should
> not be logged (see #73524).
> 
> This commit fixes this by using a \`TaskCancelledException\` instead,
> since this exception maps to a \`400 Bad Request\` and generates no logs.

---

<div class="post-metadata">

**Author:** ![Thuunder7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thuunder7/32/97482_2.png) [@Thuunder7](https://discuss.elastic.co/u/Thuunder7)\
**Post date:** [May 16, 2022, 5:42pm UTC](https://discuss.elastic.co/t/task-cancelled-warning-message-on-elastic-master-node/304838/3 "2022-05-16T17:42:11Z")

</div>

I understood the bug, but where can i make those modifications?

Regards

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 16, 2022, 6:03pm UTC](https://discuss.elastic.co/t/task-cancelled-warning-message-on-elastic-master-node/304838/4 "2022-05-16T18:03:06Z")

</div>

I'm confused - what modifications? The bug is already fixed, and a fixed version will be released as soon as we can.

---

<div class="post-metadata">

**Author:** ![Thuunder7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thuunder7/32/97482_2.png) [@Thuunder7](https://discuss.elastic.co/u/Thuunder7)\
**Post date:** [May 16, 2022, 6:06pm UTC](https://discuss.elastic.co/t/task-cancelled-warning-message-on-elastic-master-node/304838/5 "2022-05-16T18:06:48Z")

</div>

This is fixed on what version of Elasticsearch?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 16, 2022, 6:46pm UTC](https://discuss.elastic.co/t/task-cancelled-warning-message-on-elastic-master-node/304838/6 "2022-05-16T18:46:29Z")

</div>

The PR labels indicate this is currently scheduled for 7.17.4 and 8.3.0.

---

<div class="post-metadata">

**Author:** ![Thuunder7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thuunder7/32/97482_2.png) [@Thuunder7](https://discuss.elastic.co/u/Thuunder7)\
**Post date:** [May 16, 2022, 6:59pm UTC](https://discuss.elastic.co/t/task-cancelled-warning-message-on-elastic-master-node/304838/7 "2022-05-16T18:59:00Z")

</div>

Thank you very much David.

Regards

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 13, 2022, 6:59pm UTC](https://discuss.elastic.co/t/task-cancelled-warning-message-on-elastic-master-node/304838/8 "2022-06-13T18:59:29Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
