# org.apache.kafka.common.errors.TransactionTimeoutException: The transaction coordinator has aborted the transaction due to timeout

- **ID:** `kafka/transaction-abort-timeout`
- **Domain:** kafka
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A Kafka transaction exceeded the configured max.transaction.timeout.ms, causing the coordinator to abort it to free resources.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Kafka 3.6.0 | active | — | — |
| Kafka 3.7.1 | active | — | — |

## Workarounds

1. **Increase `max.transaction.timeout.ms` in broker config (e.g., to 300000) and restart broker, then set producer's `transaction.timeout.ms=120000`.** (85% success)
   ```
   Increase `max.transaction.timeout.ms` in broker config (e.g., to 300000) and restart broker, then set producer's `transaction.timeout.ms=120000`.
   ```
2. **Optimize transaction logic to complete within the default 60000ms by batching fewer records or reducing external calls.** (80% success)
   ```
   Optimize transaction logic to complete within the default 60000ms by batching fewer records or reducing external calls.
   ```
3. **Example broker config: `transaction.max.timeout.ms=300000` in server.properties, then producer config: `props.put(ProducerConfig.TRANSACTION_TIMEOUT_CONFIG, 120000);`** (88% success)
   ```
   Example broker config: `transaction.max.timeout.ms=300000` in server.properties, then producer config: `props.put(ProducerConfig.TRANSACTION_TIMEOUT_CONFIG, 120000);`
   ```

## Dead Ends

- **** — The broker's max.transaction.timeout.ms overrides the producer setting, so the timeout still applies. (75% fail)
- **** — It is not a fix; it changes the application's semantics and may cause duplicate writes. (60% fail)
