apache/cassandra · info

Request breached limit(s) on bytes in flight

Error message

Request breached limit(s) on bytes in flight (Endpoint: %d, Global: %d) and triggered backpressure.

What it means

A backpressure notice from the Dispatcher when an incoming request would breach bytes-in-flight limits - either the per-endpoint (client) limit or the global native transport byte limit. Logged INFO and sent as a client warning; the request is throttled, not failed.

Solutions

  1. Identify the offending endpoint from logs and reduce its in-flight payload (smaller pages, smaller batches).
  2. Enable/verify result paging with an appropriate fetch-size on the client driver.
  3. Raise native_transport_max_request_bytes_in_flight (endpoint/global) if hardware genuinely allows it.
  4. Fix slow clients so responses are consumed promptly, freeing in-flight bytes.

Example fix

// before: unpaged large reads Statement st = new SimpleStatement("SELECT * FROM ks.tbl"); // after: paged reads Statement st = new SimpleStatement("SELECT * FROM ks.tbl").setFetchSize(2000);
Defensive patterns

Strategy: validation

Validate before calling

// keep per-request payload small: bound IN clauses and batch size: if (inClauseValues.size() > MAX_IN) splitQuery(inClauseValues); if (batch.statements().length > MAX_BATCH) splitBatch(batch);

Try / catch

if (executionInfo.getWarnings() != null) { executionInfo.getWarnings().stream().filter(w -> w.contains("bytes in flight")).forEach(w -> reduceFetchSizeAndRetry()); }

Prevention

When it happens

Trigger: native_transport_backpressure=BYTES_IN_FLIGHT and cumulative unacknowledged request bytes exceed ClientResourceLimits endpoint or global limits - typically caused by very large batches/result sets or slow clients that do not drain responses.

Common situations: Clients issuing huge IN queries or batches with large partitions; a slow or hung consumer causing responses to queue; undersized default byte limits versus large-row workloads.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/a51e3b9a22bde579. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/transport/Dispatcher.java:413

        {
            case NONE:
                break;
            case REQUESTS:
            {
                String message = String.format("Request breached global limit of %d requests/second and triggered backpressure.",
                                               ClientResourceLimits.getNativeTransportMaxRequestsPerSecond());

                NoSpamLogger.log(logger, NoSpamLogger.Level.INFO, 1, TimeUnit.MINUTES, message);
                ClientWarn.instance.warn(message);
                break;
            }
            case BYTES_IN_FLIGHT:
            {
                String message = String.format("Request breached limit(s) on bytes in flight (Endpoint: %d, Global: %d) and triggered backpressure.",
                                               ClientResourceLimits.getEndpointLimit(), ClientResourceLimits.getGlobalLimit());

                NoSpamLogger.log(logger, NoSpamLogger.Level.INFO, 1, TimeUnit.MINUTES, message);
                ClientWarn.instance.warn(message);
                break;
            }
            case QUEUE_TIME:
            {
                String message = String.format("Request has spent over %s time of the maximum timeout %dms in the queue",
                                               DatabaseDescriptor.getNativeTransportQueueMaxItemAgeThreshold(),
                                               DatabaseDescriptor.getNativeTransportTimeout(TimeUnit.MILLISECONDS));

                NoSpamLogger.log(logger, NoSpamLogger.Level.INFO, 1, TimeUnit.MINUTES, message);
                ClientWarn.instance.warn(message);
                break;
            }
        }

        QueryState qstate = connection.validateNewMessage(request.type, connection.getVersion());

        Message.logger.trace("Received: {}, v={}", request, connection.getVersion());
        Message.Response response = request.execute(qstate, requestTime);

View on GitHub (pinned to 88fd0f6a0e)