# EsRejectedExecutionException: rejected execution of coordinating operation [coordinating_and_primary_bytes=0, replica_bytes=0, all_bytes=0, source=bulk]

- **ID:** `elasticsearch/too-many-requests-bulk-queue`
- **Domain:** elasticsearch
- **Category:** resource_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The bulk queue on the coordinating node is full due to high indexing throughput, causing new bulk requests to be rejected.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| elasticsearch 7.17 | active | — | — |
| elasticsearch 8.10 | active | — | — |
| elasticsearch 8.12 | active | — | — |

## Workarounds

1. **Implement exponential backoff retry in the client: for example, in Python using elasticsearch-py: from elasticsearch import Elasticsearch; from time import sleep; es = Elasticsearch(); for attempt in range(5): try: es.bulk(body=docs); break except Exception as e: sleep(2 ** attempt)** (85% success)
   ```
   Implement exponential backoff retry in the client: for example, in Python using elasticsearch-py: from elasticsearch import Elasticsearch; from time import sleep; es = Elasticsearch(); for attempt in range(5): try: es.bulk(body=docs); break except Exception as e: sleep(2 ** attempt)
   ```
2. **Increase the bulk queue size temporarily: PUT _cluster/settings { "transient": { "thread_pool.bulk.queue_size": 2000 } }** (75% success)
   ```
   Increase the bulk queue size temporarily: PUT _cluster/settings { "transient": { "thread_pool.bulk.queue_size": 2000 } }
   ```
3. **Scale up the coordinating nodes by adding more nodes or increasing their heap size to handle higher throughput.** (80% success)
   ```
   Scale up the coordinating nodes by adding more nodes or increasing their heap size to handle higher throughput.
   ```

## Dead Ends

- **** — Large queue sizes can lead to high memory usage and increased latency, potentially causing OOM or degraded performance. (55% fail)
- **** — Without retries, bulk requests are lost permanently, leading to data loss and incomplete indexing. (75% fail)
- **** — Fewer nodes can increase per-node load and worsen the queue pressure, making the error more frequent. (80% fail)
