Repository navigation
msgpack_factory: fix events corrupted by a previous record that failed to be packed - #5646
Open
Watson1978 wants to merge 1 commit into
Open
Watson1978 wants to merge 1 commit into
Watson1978 wants to merge 1 commit into
Conversation
…d to be packed When packing a record raises an error, the partially written bytes stay in the thread local packer. The next event stream packed on the same thread is appended to them and gets corrupted. Clear the thread local packer every time it is taken, as fluent#4178 did for the thread local unpacker. Use Packer#clear because Packer#reset needs msgpack 1.4.5 or later. Signed-off-by: Shizuo Fujita <fujita@clear-code.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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#clearbecausePacker#resetneeds 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