{"record":{"id":"b9e4c6d5d3537af0","repo":"vectordotdev/vector","slug":"pending-messages-limit-of-pending-messages-limit","errorCode":null,"errorMessage":"Pending messages limit of {pending_messages_limit} reached while processing chunk with message id {message_id} and sequence number {sequence_number}","messagePattern":"Pending messages limit of (.+?) reached while processing chunk with message id (.+?) and sequence number (.+?)","errorType":"error_code","errorClass":"ChunkedGelfDecoderError::PendingMessagesLimitReached","httpStatus":null,"severity":"error","filePath":"lib/codecs/src/decoding/framing/chunked_gelf.rs","lineNumber":478,"sourceCode":"            }\n            return Ok(Some(chunk));\n        }\n\n        let mut pending = self.state.lock().expect(\"poisoned lock\");\n\n        let is_new_message = !pending.messages.contains_key(&message_id);\n        // Settle every admission rule before creating state and a timeout task. The count limit\n        // 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 {","sourceCodeStart":460,"sourceCodeEnd":496,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/lib/codecs/src/decoding/framing/chunked_gelf.rs#L460-L496","documentation":"The chunked GELF decoder buffers incomplete messages in a pending-messages map so out-of-order UDP chunks can be reassembled. To bound memory, each decoder enforces `pending_messages_limit`; when a new chunk would push the count of pending (incomplete) messages to the limit, decoding fails with this error naming the message id, sequence number, and configured limit. It is a deliberate backpressure/memory-protection mechanism for lossy or flood conditions.","triggerScenarios":"decode_chunk receives a chunk whose message id has no pending entry while `pending.messages.len()` is already at `pending_messages_limit` — i.e. many distinct incomplete messages are buffered simultaneously.","commonSituations":"A high-volume GELF sender with heavy packet loss so most messages never complete reassembly and clog the buffer; a misconfigured (too low) `pending_messages_limit` for the traffic profile; a sender generating huge numbers of unique message ids.","solutions":["Increase `pending_messages_limit` in the source configuration to match the expected concurrency of incomplete messages.","Investigate upstream packet loss or retransmission issues that leave messages permanently incomplete.","Ensure senders chunk messages small enough (few chunks) and send chunks consecutively so they reassemble quickly.","Raise `max_buffered_payload` alongside the limit if messages are large, since both caps interact."],"exampleFix":"# before\nsources:\n  gelf:\n    decoding:\n      chunked_gelf:\n        pending_messages_limit: 16\n\n# after\nsources:\n  gelf:\n    decoding:\n      chunked_gelf:\n        pending_messages_limit: 1024","handlingStrategy":"fallback","validationCode":"// size your limit against expected concurrency of incomplete messages\nlet expected_incomplete = avg_messages_per_second * max_reassembly_seconds;\nassert!(expected_incomplete < pending_messages_limit,\n        \"pending_messages_limit too small: raise above {expected_incomplete}\");","typeGuard":null,"tryCatchPattern":"match framing.decode(&datagram) {\n    Err(e) if e.to_string().contains(\"Pending messages limit\") => {\n        // back off / shed load rather than retrying immediately\n        apply_backoff();\n        metrics.incr(\"gelf_pending_limit_hit\");\n    }\n    other => { /* handle normally */ }\n}","preventionTips":["Tune `pending_messages_limit` relative to message rate and reassembly window.","Fix upstream packet loss so incomplete messages don't accumulate.","Alert on this error — it usually signals sustained loss or flooding, not a transient blip."],"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"}