-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
streaming: Skip over unrecognized fields and fields not matching the expected type #544
Merged
Conversation
This file contains 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
…h the expected type In the Wire-based implementation of reading the raw Thrift protocol, the reader greedily reads over all of the fields in the structs, creating the Wire intermediary format. This format is then validated and parsed by the generated code, populating the appropriate Thrift object with the proper values associated with the corresponding field ID. In the stream-based implementation, validation and parsing of the raw Thrift protocol is done as the bytes are read. Since unrecognized fields were not skipped over, this caused issues in future reads as there is now data that doesn't match the expected Thrift type. Skip over fields that are unrecognized by the streaming reader and skip fields that don't match the type expected by the Thrift definition.
Codecov Report
@@ Coverage Diff @@
## dev #544 +/- ##
==========================================
- Coverage 68.22% 67.32% -0.90%
==========================================
Files 135 135
Lines 23479 23531 +52
==========================================
- Hits 16018 15842 -176
- Misses 4365 4593 +228
Partials 3096 3096
Continue to review full report at Codecov.
|
abhinav
reviewed
Sep 9, 2021
Co-authored-by: Abhinav Gupta <abg@uber.com>
abhinav
approved these changes
Sep 9, 2021
witriew
added a commit
that referenced
this pull request
Sep 9, 2021
Contains the following fix: streaming: Handle unrecognized fields and non-matching field types (#544)
witriew
added a commit
to yarpc/yarpc-go
that referenced
this pull request
Sep 9, 2021
This pulls in v1.29.2 of thriftrw which contains a fix for deserializing fields with unrecognized entries and fields with non-matching types (thriftrw/thriftrw-go#544)
witriew
added a commit
to yarpc/yarpc-go
that referenced
this pull request
Sep 9, 2021
This pulls in v1.29.2 of thriftrw which contains a fix for deserializing fields with unrecognized entries and fields with non-matching types (thriftrw/thriftrw-go#544)
3 tasks
Dogild
pushed a commit
to yarpc/yarpc-go
that referenced
this pull request
Sep 29, 2021
…#2100) This pulls in v1.29.2 of thriftrw which contains a fix for deserializing fields with unrecognized entries and fields with non-matching types (thriftrw/thriftrw-go#544)
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.
In the Wire-based implementation of reading the raw Thrift protocol, the reader
greedily reads over all of the fields in the structs, populating a Wire
intermediary format. This format is then validated and parsed by the generated
code, populating the appropriate Thrift object with the proper values
associated with the corresponding field ID.
In the stream-based implementation, validation and parsing of the raw Thrift
protocol is done as the bytes are read. Since unrecognized fields were not
skipped over, this caused issues in future reads as there is now data that
doesn't match the expected Thrift type.
Skip over fields that are unrecognized by the streaming reader and skip fields
that don't match the type expected by the Thrift definition.