Repository navigation
Conversation
grpc-go servers, such as the OpenTelemetry Collector, compress the response with the request's encoding. With a Compressor other than gzip (for example zstd), OkHttpGrpcSender failed every export with INTERNAL "Unsupported gRPC message encoding", although the server accepted the data and responded with grpc-status 0. A response compressed with the request's own encoding now resolves from its grpc-status and grpc-message. Compressor can't decompress, so the body, which only carries partial success, is skipped. Other encodings are still rejected with INTERNAL. doubleShutdown now checks the first shutdown doesn't log "Calling shutdown() multiple times." instead of that nothing was logged: the captured events can include those of the test that ran before it.
Pull request dashboard statusWaiting on the author · refreshed 2026-11-25 22:49 UTC Respond to 1 review item (e.g. link a commit, explain why not, ask a follow-up):
Status above doesn't look right?
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9058 +/- ##
============================================
- Coverage 90.56% 90.56% -0.01%
- Complexity 11197 11198 +1
============================================
Files 1032 1032
Lines 30524 30532 +8
Branches 3999 4000 +1
============================================
+ Hits 27644 27650 +6
Misses 1909 1909
- Partials 971 973 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Thanks for investigating this and providing the reproduction. There are two separate issues here: the server's response encoding and our support for decoding custom encodings.
The Collector appears noncompliant in this case. The client advertises grpc-accept-encoding: identity,gzip, but receives a zstd-compressed response. Using zstd to compress the request does not advertise support for decompressing zstd responses. The gRPC compression specification says the server SHALL send the message uncompressed when the requested response compression is unsupported by the client. It also specifies INTERNAL on the client when the server sends an unsupported encoding. Although the telemetry was received, INTERNAL is arguably the correct characterization of this noncompliant response. This appears to originate in grpc-go's default response-compressor selection and warrants an upstream report.
On the Java side, I think silently discarding the response body when its encoding matches the request is too narrow a workaround. GrpcSender is a generic transport whose response contract includes the decompressed message, even though the OTLP exporter currently ignores that message.
I'd prefer to address custom response compression generally:
- Introduce a decompressor concept, with a compatible evolution path for the existing compression SPI.
- Decode response bodies using registered decompressors, and advertise the encodings we can actually decode. The contrib zstd implementation would need to provide decompression support too.
- Support
UpstreamGrpcSenderby integrating those decompressors with grpc-java'sDecompressorRegistry, including an explicit approach for user-supplied channels. The sender-specific test assumptions currently leave this path unresolved. - Support the HTTP senders as well. Both currently reject response encodings other than gzip and identity. This is the same capability gap, although it does not establish that the Collector's HTTP receiver exhibits the same negotiation problem.
This type of approach doesn't have to be done by you and definitely not all in one PR.
Fixes #9057
grpc-go servers (such as the Collector) compress the response with the request's encoding. With a non-gzip
Compressorlike zstd,OkHttpGrpcSendercouldn't decompress it and failed every export withINTERNAL, although the data was accepted.A response in the request's own encoding now resolves from
grpc-statusand skips the body, which only carries partial success. Other encodings are still rejected.OkHttpGrpcSender.doubleShutdownno longer assumes no earlier test logged anything.