Skip to content

Health checks no longer works with legacy compression options. #8162

@s-matyukevich

Description

@s-matyukevich

What version of gRPC are you using?

Found the bug in v1.70.0 and confirmed it is wtill there in the HEAD of master.

What version of Go are you using (go version)?

go version go1.24.0 darwin/arm64

What operating system (Linux, Windows, …) and version?

Mac OS

What did you do?

Modify health example in the following way:

  • Add the following 2 options on the client
    grpc.WithCompressor(grpc.NewGZIPCompressor()),
    grpc.WithDecompressor(grpc.NewGZIPDecompressor()),
    
  • Add the following 2 options on the server
    grpc.RPCCompressor(grpc.NewGZIPCompressor()),
    grpc.RPCDecompressor(grpc.NewGZIPDecompressor()),
    

What did you expect to see?

Example working correctly

What did you see instead?

Health check failing. Client can't connect to the server.

I think I traced the issue to its root cause. If I modify this code to include decompressor provided in the options, e.g

as := &addrConnStream{
		...
                decompressorV0:   ac.cc.dopts.dc,
	}

everything is working as expected. This is not a proper fix as you also need to handle cases when compression is configured using the new API, but it should be easy to handle that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: RPC FeaturesIncludes Compression, Encoding, Attributes/Metadata, Interceptors.P2Type: Bug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions