Skip to content

Backport(v1.19): in_tcp, in_syslog: keep at-limit messages across split delimiters (#5655) - #5704

Merged
Watson1978 merged 1 commit into
v1.19from
backport-to-v1.19/pr5655
Nov 30, 2026
Merged

Watson1978 merged 1 commit into
v1.19from
backport-to-v1.19/pr5655

Conversation

@github-actions

Copy link
Copy Markdown

Which issue(s) this PR fixes:
Backport #5655

Follow-up to #5624.

What this PR does / why we need it:

A TCP read can end with the first byte of a CRLF delimiter. When the payload is already at message_length_limit, counting that byte against the limit discards an otherwise valid message.

Allow up to delimiter.bytesize - 1 extra bytes in the incomplete frame buffer. Complete messages are still checked against the same payload limit. This affects both emission paths in in_tcp and traditional framing in in_syslog.

The regression tests wait until the input has actually received the CR before sending the LF. All three cases lose the at-limit message on master and keep it with the fix.

Both input test files pass (104 tests), and RuboCop reports no offenses in the four changed files. The full local run completed 4,891 tests. All 136 failures and errors from unrelated tests were reproduced by rerunning those cases on unmodified master with the same dependency lock.

Docs Changes:

The existing plugin documentation already tells users the delimiter is excluded from the message.

Release Note:

in_tcp and in_syslog now keep valid messages at the configured length limit when a multi-byte delimiter spans TCP reads.

)

**Which issue(s) this PR fixes**:

Follow-up to #5624.

**What this PR does / why we need it**:

A TCP read can end with the first byte of a CRLF delimiter. When the
payload is already at `message_length_limit`, counting that byte against
the limit discards an otherwise valid message.

Allow up to `delimiter.bytesize - 1` extra bytes in the incomplete frame
buffer. Complete messages are still checked against the same payload
limit. This affects both emission paths in `in_tcp` and traditional
framing in `in_syslog`.

The regression tests wait until the input has actually received the CR
before sending the LF. All three cases lose the at-limit message on
master and keep it with the fix.

Both input test files pass (104 tests), and RuboCop reports no offenses
in the four changed files. The full local run completed 4,891 tests. All
136 failures and errors from unrelated tests were reproduced by
rerunning those cases on unmodified master with the same dependency
lock.

**Docs Changes**:

The existing plugin documentation already tells users the delimiter is
excluded from the message.

**Release Note**:

`in_tcp` and `in_syslog` now keep valid messages at the configured
length limit when a multi-byte delimiter spans TCP reads.

Signed-off-by: xinjun.jiang <xinjun.jiang@daocloud.io>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@Watson1978 Watson1978 added the bug Something isn't working label Nov 30, 2026
@Watson1978 Watson1978 added this to the v1.19.5 milestone Nov 30, 2026
@Watson1978
Watson1978 merged commit 9394b21 into v1.19 Nov 30, 2026
21 checks passed
@Watson1978
Watson1978 deleted the backport-to-v1.19/pr5655 branch November 30, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants