-
Notifications
You must be signed in to change notification settings - Fork 4.6k
client: allow overriding grpc-accept-encoding header #8718
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8718 +/- ##
==========================================
+ Coverage 83.30% 83.33% +0.02%
==========================================
Files 419 418 -1
Lines 32450 32433 -17
==========================================
- Hits 27033 27027 -6
+ Misses 4039 4031 -8
+ Partials 1378 1375 -3
🚀 New features to boost your workflow:
|
|
Hey @iblancasa , thank you for the PR! Before we make the changes , we should probably discuss and decide among the different suggestions Doug had in the issue :
cc : @dfawley |
|
Thanks for your quick response @eshitachandwani. I would be fine with the current solution or @dfawley suggestion. I'm willing to contribute that approach if it is what is being decided. |
|
Since the headers are sent per-call, this kind of a setting really wants to be a I think the basic idea here is fine and doesn't overlap with my suggestion of a separate registry of compressors per-channel. This would be saying "for this call, only allow compressors x/y/z for responses". There's also the question of what to do if the response comes back with a compressor the client technically supports, but isn't advertising for that call. Should it be cancelled or allowed? Also I would prefer to add this as experimental until we can determine it is fine as-is and doesn't need different behavior or a different API. These days we are doing that by adding something into the |
|
@dfawley thanks for your feedback. I tried to address it in my last push. Regarding:
I feel it makes sense to not accept it. I implemented on that way. We can change it in the future if we receive some feedback. What do you think? |
8bebac4 to
6470258
Compare
|
@dfawley @eshitachandwani any additional action items? |
Hey @iblancasa , we are still in the process of reviewing the changes. |
|
Adding @dfawley as a reviewer as he might have better context on the issue. |
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
|
@eshitachandwani thank you! |
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
|
This PR is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed. |
dfawley
left a comment
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.
This LGTM with just the visibility changes as noted.
rpc_util.go
Outdated
| // advertised in the grpc-accept-encoding header for response messages. | ||
| // Compression algorithms not in the provided list will not be advertised, and | ||
| // responses compressed with non-listed algorithms will be rejected. | ||
| func AcceptCompressors(names ...string) CallOption { |
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.
Please unexport this since we only want to expose it via experimental as before
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.
This is still exported in the latest commit.
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.
Ooops. Sorry. I think we are ok now.
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
|
Changes applied. Thanks @dfawley! |
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
grpc.WithAcceptedCompressionNamesso a client can explicitly cap thegrpc-accept-encodingheader to a vetted subset of registered compressorscompressors when needed
Updates #2786.
RELEASE NOTES:
grpc-accept-encodingheader advertised by a ClientConn.