-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
grpc: make client report Internal
status when server response contains unsupported encoding
#7461
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7461 +/- ##
==========================================
+ Coverage 81.35% 81.40% +0.05%
==========================================
Files 354 357 +3
Lines 27080 27242 +162
==========================================
+ Hits 22031 22177 +146
- Misses 3837 3849 +12
- Partials 1212 1216 +4
|
@arjan-bal I see that in some tests inside compressor_test.go we are using nopCompressor which is also a wrapper for gzip. Therefore, I’m removing the previously defined mock compressor and using nopCompressor instead. I am registering compressors on server side when serverUseNop is true using RPCCompressor and RPCDecompressor. sopts = append(sopts, grpc.RPCCompressor(newNopCompressor()), grpc.RPCDecompressor(newNopDecompressor())) The reason for using the deprecated RPCCompressor() and WithCompressor().. methods is that they allow me to register compressors selectively, limiting their usage to either the client or server based on the serverUseNop and clientUseNop fields. |
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.
LGTM, assigning a second reviewer.
Internal
status when server response contains unsupported encoding
@easwars I have addressed the comments, please review it again |
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 mostly. Just very minor comments this time around.
fixes: #6987
According to the compression test case 5, the client should report Internal error status when the the server response contains unsupported encoding. But we are getting Unimplemented error status as there is no condition written for this case in checkRecvPayload function.
Hence adding a parameter to know whether this function is being called from the client side or from the server side.
If the function is called by client and server response has unsupported encoding, then return Internal error status, if called by server and client request contains unsupported encoding, then return Unimplemented.
RELEASE NOTES: