mhlakhani opened a new pull request, #3179:
URL: https://github.com/apache/thrift/pull/3179
<!-- Explain the changes in the pull request below: -->
This commit fixes two bugs in the Rust Thrift implementation that prevented
UUID fields from working correctly with the compact protocol:
1. Missing UUID case in skip_till_depth function
- The skip function in lib/rs/src/protocol/mod.rs did not handle
TType::Uuid
- This caused "cannot skip field type Uuid" errors when trying to skip
UUID fields
- Fixed by adding: TType::Uuid => self.read_uuid().map(|_| ())
2. Incorrect UUID serialization in compact protocol
- The compact protocol was using read_bytes()/write_bytes() for UUIDs
- These methods include a length prefix, but UUIDs should be transmitted
as raw 16-byte values per the Thrift specification
- This caused "don't know what type: 15" errors during cross-language
tests
- Fixed by reading/writing UUID bytes directly without length prefix
- Implementation now matches the binary protocol's approach for
consistency
The bug manifested as failures in cross-language tests between Go and Rust
when using compact protocol. The error occurred because Go correctly expected
raw 16-byte UUID values while Rust was incorrectly adding a length prefix.
Testing:
- Verified all go-rs and rs-go cross tests now pass with compact protocol
- Tests confirm UUID values are correctly serialized and deserialized
- Both buffered and framed transports work correctly
Test command: python3 test/test.py --server go --client rs -R ".*compact.*"
🤖 Generated with [Claude Code](https://claude.ai/code)
<!-- We recommend you review the checklist/tips before submitting a pull
request. -->
- [x] Did you create an [Apache
Jira](https://issues.apache.org/jira/projects/THRIFT/issues/) ticket?
([Request account here](https://selfserve.apache.org/jira-account.html), not
required for trivial changes) --> no, trivial changes
- [x] If a ticket exists: Does your pull request title follow the pattern
"THRIFT-NNNN: describe my issue"? --> N/A
- [x] Did you squash your changes to a single commit? (not required, but
preferred)
- [x] 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.
<!--
The Contributing Guide at:
https://github.com/apache/thrift/blob/master/CONTRIBUTING.md
has more details and tips for committing properly.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]