{
  "id": "kafka/transaction-aborted-due-to-timeout",
  "signature": "org.apache.kafka.common.errors.TransactionTimeoutException: The transaction has timed out and has been aborted.",
  "signature_zh": "org.apache.kafka.common.errors.TransactionTimeoutException: 事务已超时并被中止。",
  "regex": "TransactionTimeoutException.*transaction has timed out and has been aborted",
  "domain": "kafka",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A Kafka transactional producer exceeded `transaction.timeout.ms` before committing, causing the coordinator to abort the transaction.",
  "root_cause_type": "generic",
  "root_cause_zh": "Kafka 事务性生产者在提交前超过了 `transaction.timeout.ms` 的限制，导致协调器中止了该事务。",
  "versions": [
    {
      "version": "Kafka 2.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kafka 3.1.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kafka 3.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Setting `transaction.timeout.ms` to an extremely low value to speed up transactions",
      "why_fails": "A very low timeout increases the risk of aborts under normal load, making the system unstable.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Disabling idempotence to bypass transaction timeout checks",
      "why_fails": "Transactions require idempotence; disabling it will cause configuration errors and break transactional guarantees.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase `transaction.timeout.ms` in the producer config (e.g., `transaction.timeout.ms=120000`) to accommodate longer-running transactions, and ensure the commit logic completes within this window.",
      "success_rate": 0.85,
      "how": "Increase `transaction.timeout.ms` in the producer config (e.g., `transaction.timeout.ms=120000`) to accommodate longer-running transactions, and ensure the commit logic completes within this window.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Optimize the transaction logic—e.g., reduce the number of partitions or messages per transaction, or use asynchronous commits where possible.",
      "success_rate": 0.75,
      "how": "Optimize the transaction logic—e.g., reduce the number of partitions or messages per transaction, or use asynchronous commits where possible.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase `transaction.timeout.ms` in the producer config (e.g., `transaction.timeout.ms=120000`) to accommodate longer-running transactions, and ensure the commit logic completes within this window.",
    "Optimize the transaction logic—e.g., reduce the number of partitions or messages per transaction, or use asynchronous commits where possible."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kafka.apache.org/documentation/#transaction_config",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.82,
  "resolvable": "true",
  "first_seen": "2023-06-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}