# CancelTasksRequest

**URL:** <https://discuss.elastic.co/t/canceltasksrequest/221480>\
**Category:** Elasticsearch\
**Created:** [February 28, 2020, 7:22pm UTC](https://discuss.elastic.co/t/canceltasksrequest/221480 "2020-02-28T19:22:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![waallee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/waallee/32/41289_2.png) [@waallee](https://discuss.elastic.co/u/waallee)\
**Post date:** [February 28, 2020, 7:22pm UTC](https://discuss.elastic.co/t/canceltasksrequest/221480/1 "2020-02-28T19:22:58Z")

</div>

Hi guys,

Recently I'm trying to try the task management API. I have some places confused a little bit, so hope I can get some ideas from you.

1. What's the difference between .setTaskId() and .setParentTaskId()?  
I'm assuming if I only setTaskId, only the child task will be cancelled. If I setParentTaskId, all the children tasks will be cancelled too.

2. Related to 1), is it possible that one task has parent and also has grandParent? If so, what's the behavior for canceling parent task?  
For example I have Task A. Task A has child Task B and Task B has child Task C: A -\> B -\> C  
If I send a CancelTasksRequest with parentId set to B, will B and C get cancelled and A still alive?

Thanks!

---

<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:** [March 27, 2020, 7:23pm UTC](https://discuss.elastic.co/t/canceltasksrequest/221480/2 "2020-03-27T19:23:01Z")

</div>

Closed on March 27, 2020, 7:23pm UTC

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