{
  "id": "elasticsearch/task-cancellation-timeout",
  "signature": "ElasticsearchTimeoutException: task [id:12345] cancelled with reason [timeout] after [30000ms] while waiting for completion",
  "signature_zh": "ElasticsearchTimeoutException: 任务 [id:12345] 因超时在 [30000ms] 后被取消，等待完成时触发",
  "regex": ".*task.*cancelled with reason.*timeout.*",
  "domain": "elasticsearch",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A long-running task (e.g., reindex, force merge, snapshot) exceeded the configured timeout or cancellation threshold, leading to premature termination.",
  "root_cause_type": "generic",
  "root_cause_zh": "长时间运行的任务（如重新索引、强制合并、快照）超过了配置的超时或取消阈值，导致提前终止。",
  "versions": [
    {
      "version": "7.15.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "7.17.15",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.10.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The error may be due to cluster-wide task cancellation settings (e.g., `task.max_cancellation_timeout`), not just the request timeout. Overriding locally may be ignored.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Task cancellation is recorded in cluster state, and restarting a single node does not reset the task manager on other nodes. The task will still be cancelled.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This is a security risk and may cause resource leaks. Also, it requires a node restart, which may not be feasible in production.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase the task timeout for the specific operation: POST _reindex?wait_for_completion=false&timeout=10m { \"source\": { \"index\": \"old\" }, \"dest\": { \"index\": \"new\" } }",
      "success_rate": 0.78,
      "how": "Increase the task timeout for the specific operation: POST _reindex?wait_for_completion=false&timeout=10m { \"source\": { \"index\": \"old\" }, \"dest\": { \"index\": \"new\" } }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check and update cluster-level task cancellation settings: PUT _cluster/settings { \"persistent\": { \"task.max_cancellation_timeout\": \"120s\" } }",
      "success_rate": 0.82,
      "how": "Check and update cluster-level task cancellation settings: PUT _cluster/settings { \"persistent\": { \"task.max_cancellation_timeout\": \"120s\" } }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Retry the task with a smaller batch size or fewer shards to reduce execution time: POST _reindex { \"source\": { \"index\": \"old\", \"size\": 500 }, \"dest\": { \"index\": \"new\" } }",
      "success_rate": 0.75,
      "how": "Retry the task with a smaller batch size or fewer shards to reduce execution time: POST _reindex { \"source\": { \"index\": \"old\", \"size\": 500 }, \"dest\": { \"index\": \"new\" } }",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase the task timeout for the specific operation: POST _reindex?wait_for_completion=false&timeout=10m { \"source\": { \"index\": \"old\" }, \"dest\": { \"index\": \"new\" } }",
    "Check and update cluster-level task cancellation settings: PUT _cluster/settings { \"persistent\": { \"task.max_cancellation_timeout\": \"120s\" } }",
    "Retry the task with a smaller batch size or fewer shards to reduce execution time: POST _reindex { \"source\": { \"index\": \"old\", \"size\": 500 }, \"dest\": { \"index\": \"new\" } }"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html#task-cancellation",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.79,
  "resolvable": "true",
  "first_seen": "2024-01-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}