Loading

Stuck Task

One or more cluster tasks have run longer than the configured stuck-task threshold. Long reindex, update-by-query, delete-by-query, or snapshot work can be legitimate on large datasets, but tasks that never finish can hold cluster state and stress nodes.

Note

For a complete list of insights, refer to AutoOps insights.

Field Value
Component Elasticsearch
Severity Medium
Scope Node
Domains performance, stability, tasks

The following is an example of what you might see when this insight is triggered. Real insights use live data and links from your deployment or cluster.

Summary: There are 3 tasks that ran more than the 12 minutes threshold. The longest task running start time was 2026-03-15T14:22:00 UTC time. The longest task running time is 420 ms. ACTIVE TASKS: NodeName: logs-prod-000045-     TaskId:  es-data-01:4521

    TaskSerialNumber:  12

    TaskType:  logs-prod-000045

    Description:  bulk index to logs-prod-000045

    StartTimeInMillis:  1710502920000

    runningTimeInMinutes:  48

    Cancellable:   true

    Action:  indices:data/write/bulk

    Headers:  {} HISTORY TASKS: NodeName:logs-prod-000045-     TaskId:  es-data-01:4521

    TaskSerialNumber:  12

    TaskType:  logs-prod-000045

    Description:  bulk index to logs-prod-000045

    StartTimeInMillis:  1710502920000

    runningTimeInMinutes:  48

    Cancellable:   true

    Action:  indices:data/write/bulk

    Headers:  {}

Note

AutoOps shows different recommendations depending on how their conditions match your deployment or cluster.

Impact: Stuck tasks might affect the cluster performance. The most common tasks that might run for such a long time are reindex tasks as well as update and delete by query tasks. Depending on how much data those tasks need to process, it might be perfectly normal for them to run this long. If this is your case, then you don't really need to worry, but make sure to monitor those tasks carefully to make sure they don't overwhelm your cluster. Another potential candidate is snapshot tasks that can get stuck in some edge cases, for instance when:

  • a shard gets unassigned for some reason
  • a shard gets corrupted
  • a node hosting a primary shard being snapshotted goes down while the operation is in progress and there's no replica
  • a circuit breaking exception or an OutOfMemoryError happens on the master node
  • snapshot retention is either not configured at all or configured to retain snapshots for too long In any case, you might want to closely monitor your cluster to make sure its performance is not affected and review the recommendations below to get rid of the stuck task(s).