# Why a cancelled task is still on the list?

**URL:** <https://discuss.elastic.co/t/why-a-cancelled-task-is-still-on-the-list/336413>\
**Category:** Elasticsearch\
**Created:** [June 20, 2023, 2:24am UTC](https://discuss.elastic.co/t/why-a-cancelled-task-is-still-on-the-list/336413 "2023-06-20T02:24:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![HyebinHong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hyebinhong/32/122465_2.png) [@HyebinHong](https://discuss.elastic.co/u/HyebinHong)\
**Post date:** [June 20, 2023, 2:24am UTC](https://discuss.elastic.co/t/why-a-cancelled-task-is-still-on-the-list/336413/1 "2023-06-20T02:24:53Z")

</div>

Hello, elastic!

While running multiple msearch API through Java clients, I found one of the tasks took abnormally long.  
So I executed `Task Cancel API`, but it doesn't seem cleanup properly.  
When I check the task via `Task API`, it shows `cancelled: true`, `cancellable: true`, `completed: false` and running time is still increasing.  
I know it doesn't work right away, however, it has been almost a day.  
Now, I need to figure it out what should I do in this situation.

My question is:

1. Why cancelled task (cancelled: true) is still on the list? Do I need to keep waiting?
2. What could be the solution for this situation? delete the task forcibly? reboot server? force merge? etc
3. Does `DELETE .tasks/task/_doc/<yourtaskid>` delete a specific task? and is there no side effects?  
([How to delete a task in Elasticsearch v7.14 - #7 by stephenb](https://discuss.elastic.co/t/how-to-delete-a-task-in-elasticsearch-v7-14/283321/7))
4. Is there anything more I can check?

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 20, 2023, 4:29am UTC](https://discuss.elastic.co/t/why-a-cancelled-task-is-still-on-the-list/336413/2 "2023-06-20T04:29:46Z")

</div>

Hello,

What is your Elasticsearch version? You didn't mention it.

---

<div class="post-metadata">

**Author:** ![HyebinHong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hyebinhong/32/122465_2.png) [@HyebinHong](https://discuss.elastic.co/u/HyebinHong)\
**Post date:** [June 20, 2023, 4:34am UTC](https://discuss.elastic.co/t/why-a-cancelled-task-is-still-on-the-list/336413/3 "2023-06-20T04:34:40Z")

</div>

sorry for that. It is 7.10!

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 20, 2023, 4:42am UTC](https://discuss.elastic.co/t/why-a-cancelled-task-is-still-on-the-list/336413/4 "2023-06-20T04:42:31Z")

</div>

7.10 is pretty old and no more supported.

I don't think that there is much that you can do, I would suggest that you try to restart the node where the task is running to see if this solve this issue.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 20, 2023, 6:13am UTC](https://discuss.elastic.co/t/why-a-cancelled-task-is-still-on-the-list/336413/5 "2023-06-20T06:13:59Z")

</div>

You should also upgrade.

---

<div class="post-metadata">

**Author:** ![HyebinHong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hyebinhong/32/122465_2.png) [@HyebinHong](https://discuss.elastic.co/u/HyebinHong)\
**Post date:** [June 20, 2023, 6:34am UTC](https://discuss.elastic.co/t/why-a-cancelled-task-is-still-on-the-list/336413/6 "2023-06-20T06:34:34Z")

</div>

Is there any solution if I upgrade to 8.8 and face the same problem?

---

<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:** [June 20, 2023, 7:22am UTC](https://discuss.elastic.co/t/why-a-cancelled-task-is-still-on-the-list/336413/7 "2023-06-20T07:22:48Z")

</div>

I think this is a bug. Possibly it's been fixed already in the couple of years since 7.10 was released, but if you can reproduce it in a supported version then I would like to investigate further.

---

<div class="post-metadata">

**Author:** ![HyebinHong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hyebinhong/32/122465_2.png) [@HyebinHong](https://discuss.elastic.co/u/HyebinHong)\
**Post date:** [June 21, 2023, 8:15am UTC](https://discuss.elastic.co/t/why-a-cancelled-task-is-still-on-the-list/336413/9 "2023-06-21T08:15:45Z")

</div>

Unfortunately, it is barely possible to upgrade the current version in my situation.

Anyway..  
After rebooting the nodes, the deadlock task on the list has been removed for now.  
I will let you know, when I face the same problem again.

Thanks for helping!

---

<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:** [July 19, 2023, 8:15am UTC](https://discuss.elastic.co/t/why-a-cancelled-task-is-still-on-the-list/336413/10 "2023-07-19T08:15:50Z")

</div>

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