Skip to content
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

Compression is flaky when using Metadata in call #686

Closed
mwitkow opened this issue May 17, 2016 · 2 comments
Closed

Compression is flaky when using Metadata in call #686

mwitkow opened this issue May 17, 2016 · 2 comments

Comments

@mwitkow
Copy link
Contributor

mwitkow commented May 17, 2016

You can easily make the TestCompressOK test fail by adding client-side metadata.

    ctx := metadata.NewContext(context.Background(), metadata.Pairs("something", "something"))
    if _, err := tc.UnaryCall(ctx, req); err != nil {
        t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, <nil>", err)
    }

This has been a massive time sink in #683. It seems that the sendCompress secition in code in http2Server.WriteHeader never gets called

    if s.sendCompress != "" {
        fmt.Printf("Calling send compress!\n")
        t.hEnc.WriteField(hpack.HeaderField{Name: "grpc-encoding", Value: s.sendCompress})
    }
@mwitkow
Copy link
Contributor Author

mwitkow commented May 17, 2016

The problem is that the grpc-encoding client doesn't receive a grpc-encoding header.

@mwitkow
Copy link
Contributor Author

mwitkow commented May 17, 2016

The problem is:
In Server.processUnaryRPC the call to set the compression mode of the stream ( stream.SetSendCompress(s.opts.cp.Type())) is made too late, and some SendHeader calls already completed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant