Skip to content

Commit

Permalink
Add note on troubleshooting laggy cancellations (#97485) (#97498)
Browse files Browse the repository at this point in the history
Today we document that tasks may not react to cancellations immediately,
but in practice it's surprising to users and kind of a bug if they run
for too long after being cancelled. This commit adds a little extra
detail about the information to collect to troubleshoot such a
situation.
  • Loading branch information
DaveCTurner committed Jul 10, 2023
1 parent 49c8327 commit 3414aa7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
5 changes: 3 additions & 2 deletions docs/reference/cluster/nodes-hot-threads.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

Returns the hot threads on each selected node in the cluster.


[[cluster-nodes-hot-threads-api-request]]
==== {api-request-title}

Expand Down Expand Up @@ -53,7 +52,9 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=node-id]

`threads`::
(Optional, integer) Specifies the number of hot threads to provide
information for. Defaults to `3`.
information for. Defaults to `3`. If you are using this API for
troubleshooting, set this parameter to a large number (e.g.
`9999`) to get information about all the threads in the system.

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]

Expand Down
15 changes: 10 additions & 5 deletions docs/reference/cluster/tasks.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,16 @@ POST _tasks/_cancel?nodes=nodeId1,nodeId2&actions=*reindex
--------------------------------------------------

A task may continue to run for some time after it has been cancelled because it
may not be able to safely stop its current activity straight away. The list
tasks API will continue to list these cancelled tasks until they complete. The
`cancelled` flag in the response to the list tasks API indicates that the
cancellation command has been processed and the task will stop as soon as
possible.
may not be able to safely stop its current activity straight away, or because
{es} must complete its work on other tasks before it can process the
cancellation. The list tasks API will continue to list these cancelled tasks
until they complete. The `cancelled` flag in the response to the list tasks API
indicates that the cancellation command has been processed and the task will
stop as soon as possible. To troubleshoot why a cancelled task does not
complete promptly, use the list tasks API with the `?detailed` parameter to
identify the other tasks the system is running and also use the
<<cluster-nodes-hot-threads>> API to obtain detailed information about the work
the system is doing instead of completing the cancelled task.

===== Task Grouping

Expand Down

0 comments on commit 3414aa7

Please sign in to comment.