Skip to content

Backport(v1.19): msgpack_factory: fix events corrupted by a previous record that failed to be packed (#5646) - #5652

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

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

Conversation

@github-actions

Copy link
Copy Markdown

Which issue(s) this PR fixes:
Backport #5646
Fixes #

What this PR does / why we need it:
When packing a record raises an error, such as RangeError for an Integer larger than 64 bits, the partially written bytes stay in the thread local packer and corrupt the next event stream packed on the same thread. For example, after in_http receives such a record, out_forward sends the next event from another client as {"big":[<time>,{"user":"other client"}]}.

This PR clears the thread local packer every time it is taken, as #4178 did for the thread local unpacker. It uses Packer#clear because Packer#reset needs msgpack 1.4.5 or later.

Docs Changes:
N/A

Release Note:
msgpack_factory: fix events corrupted by a previous record that failed to be packed

🤖 Generated with Claude Code

…d to be packed (#5646)

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

**What this PR does / why we need it**:
When packing a record raises an error, such as RangeError for an Integer
larger than 64 bits, the partially written bytes stay in the thread
local packer and corrupt the next event stream packed on the same
thread. For example, after in_http receives such a record, out_forward
sends the next event from another client as
`{"big":[<time>,{"user":"other client"}]}`.

This PR clears the thread local packer every time it is taken, as #4178
did for the thread local unpacker. It uses `Packer#clear` because
`Packer#reset` needs msgpack 1.4.5 or later.

**Docs Changes**:
N/A

**Release Note**:
msgpack_factory: fix events corrupted by a previous record that failed
to be packed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@Watson1978
Watson1978 merged commit 5580581 into v1.19 Nov 18, 2026
21 checks passed
@Watson1978
Watson1978 deleted the backport-to-v1.19/pr5646 branch November 18, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant