THRIFT-5383 Fix misplaced capacity check#2366
Closed
aaronstgeorge-wf wants to merge 2 commits intoapache:masterfrom
Closed
THRIFT-5383 Fix misplaced capacity check#2366aaronstgeorge-wf wants to merge 2 commits intoapache:masterfrom
aaronstgeorge-wf wants to merge 2 commits intoapache:masterfrom
Conversation
Contributor
Author
|
I'm not sure how we could know the size before reading the string? Because this is in the JSON protocol there is no preceding size packed in the data. All you have is the open quote character and you have to read to the end. This check makes sense for compact, binary, et al because they are serialized with the size of the string contained after, but the serialized JSON representation has no such thing. It's just a quote-delimited string. |
96b703a to
65be602
Compare
Contributor
Author
|
I think we we got off on the wrong foot here. Where should that line be? I'm quite happy to move it and write a test that asserts it does what it is supposed to do. From what I know about the JSON protocol, I'm just not sure what it's supposed to do, or where it's supposed to be. I am not a thrift expert. |
Jens-G
pushed a commit
to Jens-G/thrift
that referenced
this pull request
Jun 10, 2021
Client: java Patch: Aaron St. George This closes apache#2366
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.
The added test passes with thrift 0.13.0 and fails on 0.14.0. The source of the error seems to be an unnecessary capacity check when reading JSON string.
[skip ci]anywhere in the commit message to free up build resources.