Task Management Queue Buildup
warningLong-running or stuck tasks accumulate in the task manager, potentially blocking critical operations and consuming resources.
elasticsearch.task.stats showing increasing number of tasks or tasks with very long runtime (>5 minutes for typical operations)
Identify long-running tasks via _tasks API with detailed:true. Common patterns: (1) Reindex operations - monitor progress and consider chunking large reindex jobs, (2) Force merge operations - these are expected to run long, set realistic timeouts, (3) Search operations - use task cancellation API to kill stuck queries. Set task timeout headers (timeout parameter) on operations to prevent indefinite execution. Review cluster.max_shards_per_node if shards-per-node limits are blocking operations. Monitor elasticsearch.node.operations.current to identify operation types causing backlog. Use X-Opaque-Id header to trace task origins to applications.