THRIFT-6124: Reset reused Ruby deserialization targets - #3679
Merged
Conversation
Client: rb Co-Authored-By: OpenAI Codex (GPT-5.6) <codex@openai.com>
kpumuk
force-pushed
the
rb-deserialization-reset
branch
from
July 28, 2026 14:35
3a50404 to
813729d
Compare
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.
Ruby deserialization populates an object supplied by the caller, but previously did not clear values left by an earlier read. When a later payload omitted a field, the target could retain stale data from the previous message. Reused unions could similarly retain their previous discriminator and value after unknown or incomplete input.
This change resets structs and unions before reading a new value. Struct defaults are restored using fresh copies, while fields without defaults are cleared. The native extension performs the same work directly in C and skips the reset scan for fresh targets, preserving parity without adding a Ruby callback to the accelerated read path.
[skip ci]anywhere in the commit message to free up build resources.