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
THRIFT-5784: Add THeaderTransforms to TConfiguration #2973
Conversation
// Reset writeTransforms to the ones from cfg, as we are going to add | ||
// compression transforms from what we read, we don't want to accumulate | ||
// different transforms read from different requests | ||
t.writeTransforms = t.cfg.GetTHeaderTransforms() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few notes here:
- in TSimpleServer we use the same THeaderProtocol instance for incoming and outgoing, while in TStandardClient we use different THeaderProtocol instances, so this behavior should only affect servers (clients would not use the THeaderProtocol read for writing)
- the consideration here (and the NOTE added in
AddTransform
) is for a hypothetical scenario: if a server have a long client connection, but the long client connection is actually multiple clients (e.g. it's a proxy), and those multiple clients use different compression transforms (we currently only support zlib, but the spec also defined snappy so we might support that some day in the future), we don't want to add different compression transforms cumulatively and doing both, but just use the same compression used by the request in the response. Maybe we should markAddTransform
as deprecated instead? the new feature in TConfiguration should be enough to replace that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should mark AddTransform as deprecated instead?
Agreed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Also added a real test for req and resp compression.
08c068f
to
bfe7d9a
Compare
@dcelasun mind taking another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
bfe7d9a
to
12db087
Compare
Client: go While I'm here, also auto add compression transforms read (currently only zlib is supported) to writeTransforms so that a server will auto use the same compression on the responses as the client chose to use in the requests.
12db087
to
0b5c575
Compare
Client: go
While I'm here, also auto add compression transforms read (currently only zlib is supported) to writeTransforms so that a server will auto use the same compression on the responses as the client chose to use in the requests.