{"record":{"id":"f83b6296b7faec99","repo":"vectordotdev/vector","slug":"buffered-payload-limit-of-limit-bytes-reached-while","errorCode":null,"errorMessage":"Buffered payload limit of {limit} bytes reached while processing chunk with message id {message_id} and sequence number {sequence_number}. Discarding all buffered chunks of that message.","messagePattern":"Buffered payload limit of (.+?) bytes reached while processing chunk with message id (.+?) and sequence number (.+?)\\. Discarding all buffered chunks of that message\\.","errorType":"error_code","errorClass":"ChunkedGelfDecoderError::BufferedPayloadLimitReached","httpStatus":null,"severity":"error","filePath":"lib/codecs/src/decoding/framing/chunked_gelf.rs","lineNumber":486,"sourceCode":"        // applies only on insert, since rejecting chunks of pending messages would stall them.\n        if is_new_message {\n            if chunk_len > self.max_length {\n                return Err(ChunkedGelfDecoderError::MaxLengthExceed {\n                    message_id,\n                    sequence_number,\n                    length: chunk_len,\n                    max_length: self.max_length,\n                });\n            }\n            ensure!(\n                pending.messages.len() < self.pending_messages_limit,\n                PendingMessagesLimitReachedSnafu {\n                    message_id,\n                    sequence_number,\n                    pending_messages_limit: self.pending_messages_limit\n                }\n            );\n            ensure!(\n                pending.buffered_payload.saturating_add(chunk_len) <= self.max_buffered_payload,\n                BufferedPayloadLimitReachedSnafu {\n                    message_id,\n                    sequence_number,\n                    limit: self.max_buffered_payload,\n                }\n            );\n        }\n\n        if is_new_message {\n            let state = Arc::clone(&self.state);\n            let timeout = self.timeout;\n            let timeout_handle = tokio::spawn(async move {\n                tokio::time::sleep(timeout).await;\n                let timeout_task_id = tokio::task::id();\n                let mut pending = state.lock().expect(\"poisoned lock\");\n                let owns_message = pending\n                    .messages","sourceCodeStart":468,"sourceCodeEnd":504,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/lib/codecs/src/decoding/framing/chunked_gelf.rs#L468-L504","documentation":"Beyond counting pending messages, the chunked GELF decoder bounds total buffered bytes per incomplete message via `max_buffered_payload`. Before appending a chunk, it checks `pending.buffered_payload + chunk_len <= max_buffered_payload` (saturating add) and, if exceeded, fails with this error and discards all buffered chunks of that message. This prevents a single oversized or repeatedly re-sent message id from exhausting memory.","triggerScenarios":"decode_chunk receives a chunk for an existing pending message where adding the chunk's length to `pending.buffered_payload` (saturating) would exceed `self.max_buffered_payload` — either very large accumulated messages or the same message id being re-sent repeatedly due to loss.","commonSituations":"A sender emitting GELF messages larger than the configured buffer allows; severe packet loss causing duplicate re-sends of the same message id that inflate the buffered payload; a too-low `max_buffered_payload` setting relative to legitimate message sizes.","solutions":["Increase `max_buffered_payload` in the source configuration to accommodate your largest legitimate chunked GELF messages.","Split oversized messages at the sender or send them via a non-chunked transport (TCP GELF) instead.","Check for packet loss/duplication causing the same message id to be retransmitted and inflate the buffer.","Note the affected message's buffered chunks are discarded on this error — retransmission must come from the sender."],"exampleFix":"# before\nsources:\n  gelf:\n    decoding:\n      chunked_gelf:\n        max_buffered_payload: 65535\n\n# after\nsources:\n  gelf:\n    decoding:\n      chunked_gelf:\n        max_buffered_payload: 1048576","handlingStrategy":"fallback","validationCode":"// ensure the largest message fits the buffer\nlet max_msg_bytes = total_chunks_max * chunk_size;\nassert!(max_msg_bytes <= max_buffered_payload,\n        \"max_buffered_payload must be at least {max_msg_bytes} bytes\");","typeGuard":null,"tryCatchPattern":"match framing.decode(&datagram) {\n    Err(e) if e.to_string().contains(\"Buffered payload limit\") => {\n        // chunks of this message were discarded; rely on sender retransmission\n        warn!(\"oversized/duplicated GELF message dropped: {e}\");\n        metrics.incr(\"gelf_payload_limit_hit\");\n    }\n    other => { /* handle normally */ }\n}","preventionTips":["Set `max_buffered_payload` above your largest legitimate chunked message.","Send very large payloads over TCP GELF or split them at the source.","Watch for duplicate re-sends of the same message id (lossy networks) that inflate the buffer."],"tags":["gelf","udp","codecs","buffer-limit","rust"],"backgroundTag":"payload-too-large","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}