View and terminate running tasks

Updated at:

The Task Management page in the Alibaba Cloud Elasticsearch console displays the tasks that are running in the cluster. For each task, the page shows the node where the task runs, the task ID, the task type, the action identifier, and the running duration. When tasks such as slow queries or abnormal writes consume cluster resources, you can terminate cancellable tasks individually or in bulk to release the resources immediately. Before you start, make sure that an Alibaba Cloud Elasticsearch instance is created.

Open the Task Management page

  1. Log on to the Alibaba Cloud Elasticsearch console. In the left-side navigation pane, click Elasticsearch Clusters.

  2. In the instance list, click the ID of the target instance to open the instance details page.

  3. In the left-side navigation pane, choose Operations Management > Task Management.

View running tasks

Three task counts appear above the task list: Running Tasks, Cancellable Tasks, and Tasks running over 1 minute. Use these counts to quickly determine whether the cluster has tasks that have been running for a long time and how many of the running tasks can be terminated.

Task list fields

The following table describes the columns of the task list. Note that two columns are labeled Actions: one shows the action identifier of each task, and the other shows the operations that you can perform on each task.

Column

Description

Node Name

The name of the node that runs the task.

Task ID

The unique identifier of the task on the node. Use it to locate the task when you terminate it.

Type

The type of the task. Task types include local direct tasks, transport-layer tasks, persistent tasks, master node tasks, enrich execution tasks, model import tasks, and model deployment allocation tasks.

Actions

The operation name and action identifier of the task, for example, a search query (indices:data/read/search).

Duration

The running duration of the task, displayed as Xs (X seconds), XmYs (X minutes and Y seconds), or XhYm (X hours and Y minutes).

Actions

The operations that you can perform on the task. Cancellable tasks display End Task. Tasks with descriptive information display Details. Click Details to view the complete task description (the request statement) in the Task Operation Details panel.

Filter tasks

The task list provides the following filtering and display options to help you find a target task:

  • Task Type: Filters tasks by task type.

  • Node Name: Filters tasks by node name.

  • Actions: Filters tasks by action group. Each group corresponds to an action wildcard identifier.

  • Keyword: Searches the list with a fuzzy match on the task ID, action, or task description (the request statement).

  • Running Duration: Filters tasks whose running duration exceeds the specified threshold. Supported units are seconds, minutes, and hours. Use this option to quickly find slow tasks that have been running for a long time.

  • Show Cancellable Tasks Only: When selected, displays only cancellable tasks.

  • Parent-Child Grouping and All Tasks: By default, tasks are displayed in parent-child groups, and you can expand a parent task to view its child tasks. Select All Tasks to display all tasks in a flat list.

  • Auto Refresh: When enabled, the page automatically refreshes the task list every 10 seconds. When disabled, click the refresh button to refresh the list manually.

Terminate running tasks

For tasks that have been running for a long time or are behaving abnormally, you can terminate them in the task list to immediately release the resources that they consume. Terminating a task individually affects only that task. Bulk termination affects all tasks of the selected types on the selected nodes at once, which may include tasks that you did not select.

Usage notes

Before you terminate a task, take note of the following items:

  • Irreversible impact — A terminated task does not complete normally: data that is being written might be left incomplete, and queries whose results are being returned will fail. Before you proceed, identify the task by its task ID and action, and make sure that your business can tolerate incomplete writes and failed queries.

  • Cancellable tasks only — Only tasks whose cancellable value is true can be terminated. A task that cannot be terminated does not display the End Task button. To display only the tasks that can be terminated, select Show Cancellable Tasks Only.

  • System tasks restart automatically — Persistent tasks that the system runs in the background, such as geoip-downloader and health-node, are automatically restarted after you terminate them. The restarted task appears in the task list with a new task ID. This is expected behavior.

Terminate a task

  1. Find the target task in the task list, and click End Task. To narrow down a long list, search by task ID with the Keyword filter, or select Show Cancellable Tasks Only to display only the tasks that can be terminated.

  2. In the Confirm Action dialog box, select I understand the risks of this operation., and then click OK.

  3. Verify the result: the task is terminated immediately and no longer appears in the task list after the list refreshes. If the task completed before you submitted the termination, the page indicates that the task does not exist.

Terminate tasks in bulk

  1. Select the tasks to terminate in the task list.

  2. Click Bulk Terminate above the list.

  3. In the Confirm Action dialog box, select I understand the risks of this operation., and then click OK.

    After you confirm, all tasks of the selected types on the selected nodes are terminated. The terminated tasks no longer appear in the task list after the list refreshes.