Skip to content

THRIFT-6126: Handle unknown Compact and JSON types - #3681

Merged
kpumuk merged 1 commit into
apache:masterfrom
kpumuk:rb-server-type-errors
Jul 29, 2026
Merged

THRIFT-6126: Handle unknown Compact and JSON types#3681
kpumuk merged 1 commit into
apache:masterfrom
kpumuk:rb-server-type-errors

Conversation

@kpumuk

@kpumuk kpumuk commented Jul 28, 2026

Copy link
Copy Markdown
Member

Ruby Compact and JSON protocol implementations currently allow unknown field and container type identifiers to escape as generic runtime exceptions. In SimpleServer, those exceptions can leave the per-connection protocol error path and stop the accept loop, preventing a later valid client from being processed.

This change reports unknown Compact and JSON types as ProtocolException::INVALID_DATA. The native and pure-Ruby Compact implementations now expose matching exception metadata and preserve the original invalid writer type in diagnostics. SimpleServer can therefore close only the malformed connection and continue accepting clients.

The fuzz harness now relies on these typed exceptions and drops obsolete message matching for invalid types, union validation, negative container sizes, and JSON encoding failures.

  • Did you create an Apache Jira ticket? THRIFT-6126
  • 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.

Client: rb

Co-Authored-By: OpenAI Codex (GPT-5.6) <codex@openai.com>
Copilot AI review requested due to automatic review settings July 28, 2026 17:37

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
@kpumuk
kpumuk merged commit b9b48cd into apache:master Jul 29, 2026
95 checks passed
@kpumuk
kpumuk deleted the rb-server-type-errors branch July 29, 2026 13:45
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