Skip to content
Latchkey

Elasticsearch "circuit_breaking_exception ... Data too large" in CI

Elasticsearch tripped a circuit breaker to stop a request that would push heap usage past a safe limit, raising circuit_breaking_exception ... Data too large. On a CI service container with a small heap, an aggregation or bulk request can hit the parent breaker even though the data volume is modest.

What this error means

A request fails with HTTP 429 and "circuit_breaking_exception ... [parent] Data too large, data for [<request>] would be [...] which is larger than the limit". The heap on the CI container is small.

elasticsearch
{"error":{"type":"circuit_breaking_exception","reason":"[parent] Data too large,
data for [<http_request>] would be [520000000/495.9mb], which is larger than the limit of
[510000000/486.3mb]","bytes_wanted":520000000,"bytes_limit":510000000},"status":429}

Common causes

The CI heap is too small for the request

A tiny -Xmx (set to keep the container light) leaves little headroom, so an aggregation or bulk load trips the parent breaker.

A single request needs a lot of heap

A large bulk body, a broad aggregation, or a big search response can momentarily require more memory than the breaker allows.

How to fix it

Give the container a larger heap

  1. Raise -Xmx/-Xms in ES_JAVA_OPTS so the breaker limit scales up.
  2. Increase the container memory limit alongside the heap.
  3. Re-run and confirm the request stays under the breaker.
.github/workflows/ci.yml
env:
  discovery.type: single-node
  ES_JAVA_OPTS: -Xms1g -Xmx1g

Shrink the request

Split large bulk requests into smaller batches and narrow aggregations so no single request needs more heap than the breaker permits.

How to prevent it

  • Size the CI heap to match the heaviest request your tests make.
  • Batch bulk indexing instead of sending one huge request.
  • Keep container memory comfortably above the configured heap.

Frequently asked questions

What causes ""circuit_breaking_exception ... Data too large""?
A tiny -Xmx (set to keep the container light) leaves little headroom, so an aggregation or bulk load trips the parent breaker.
How do I fix "circuit_breaking_exception ... Data too large"?
Give the container a larger heap

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card