Skip to content

THRIFT-6124: Reset reused Ruby deserialization targets - #3679

Merged
kpumuk merged 1 commit into
apache:masterfrom
kpumuk:rb-deserialization-reset
Jul 29, 2026
Merged

THRIFT-6124: Reset reused Ruby deserialization targets#3679
kpumuk merged 1 commit into
apache:masterfrom
kpumuk:rb-deserialization-reset

Conversation

@kpumuk

@kpumuk kpumuk commented Jul 28, 2026

Copy link
Copy Markdown
Member

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.

  • Did you create an Apache Jira ticket? THRIFT-6124
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • Did you squash your changes to a single commit? (not required, but preferred)
  • Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
  • If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

Copilot AI review requested due to automatic review settings July 28, 2026 14:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mergeable mergeable Bot added the ruby Pull requests that update Ruby code label Jul 28, 2026
Client: rb

Co-Authored-By: OpenAI Codex (GPT-5.6) <codex@openai.com>
@kpumuk
kpumuk force-pushed the rb-deserialization-reset branch from 3a50404 to 813729d Compare July 28, 2026 14:35
Copilot AI review requested due to automatic review settings July 28, 2026 14:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kpumuk
kpumuk merged commit d1d7280 into apache:master Jul 29, 2026
95 checks passed
@kpumuk
kpumuk deleted the rb-deserialization-reset branch July 29, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ruby Pull requests that update Ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants