{"record":{"id":"a51e3b9a22bde579","repo":"apache/cassandra","slug":"request-breached-limit-s-on-bytes-in-flight-endp","errorCode":null,"errorMessage":"Request breached limit(s) on bytes in flight (Endpoint: %d, Global: %d) and triggered backpressure.","messagePattern":"Request breached limit\\(s\\) on bytes in flight \\(Endpoint: (.+?), Global: (.+?)\\) and triggered backpressure\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/java/org/apache/cassandra/transport/Dispatcher.java","lineNumber":413,"sourceCode":"        {\n            case NONE:\n                break;\n            case REQUESTS:\n            {\n                String message = String.format(\"Request breached global limit of %d requests/second and triggered backpressure.\",\n                                               ClientResourceLimits.getNativeTransportMaxRequestsPerSecond());\n\n                NoSpamLogger.log(logger, NoSpamLogger.Level.INFO, 1, TimeUnit.MINUTES, message);\n                ClientWarn.instance.warn(message);\n                break;\n            }\n            case BYTES_IN_FLIGHT:\n            {\n                String message = String.format(\"Request breached limit(s) on bytes in flight (Endpoint: %d, Global: %d) and triggered backpressure.\",\n                                               ClientResourceLimits.getEndpointLimit(), ClientResourceLimits.getGlobalLimit());\n\n                NoSpamLogger.log(logger, NoSpamLogger.Level.INFO, 1, TimeUnit.MINUTES, message);\n                ClientWarn.instance.warn(message);\n                break;\n            }\n            case QUEUE_TIME:\n            {\n                String message = String.format(\"Request has spent over %s time of the maximum timeout %dms in the queue\",\n                                               DatabaseDescriptor.getNativeTransportQueueMaxItemAgeThreshold(),\n                                               DatabaseDescriptor.getNativeTransportTimeout(TimeUnit.MILLISECONDS));\n\n                NoSpamLogger.log(logger, NoSpamLogger.Level.INFO, 1, TimeUnit.MINUTES, message);\n                ClientWarn.instance.warn(message);\n                break;\n            }\n        }\n\n        QueryState qstate = connection.validateNewMessage(request.type, connection.getVersion());\n\n        Message.logger.trace(\"Received: {}, v={}\", request, connection.getVersion());\n        Message.Response response = request.execute(qstate, requestTime);","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/transport/Dispatcher.java#L395-L431","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Identify the offending endpoint from logs and reduce its in-flight payload (smaller pages, smaller batches).","Enable/verify result paging with an appropriate fetch-size on the client driver.","Raise native_transport_max_request_bytes_in_flight (endpoint/global) if hardware genuinely allows it.","Fix slow clients so responses are consumed promptly, freeing in-flight bytes."],"exampleFix":"// 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);","handlingStrategy":"validation","validationCode":"// 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);","typeGuard":null,"tryCatchPattern":"if (executionInfo.getWarnings() != null) { executionInfo.getWarnings().stream().filter(w -> w.contains(\"bytes in flight\")).forEach(w -> reduceFetchSizeAndRetry()); }","preventionTips":["Always page large reads with a bounded fetch size.","Cap batch sizes well below the configured byte limits.","Ensure clients consume responses promptly (no stalled consumers).","Raise bytes-in-flight limits only after sizing server memory."],"tags":["native-transport","backpressure","bytes-in-flight","throttling"],"backgroundTag":"rate-limit-exceeded","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}