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

doc: mark CustomCodec as deprecated #3698

Merged
merged 3 commits into from Jun 26, 2020

Conversation

menghanl
Copy link
Contributor

fixes #3694

server.go Outdated
@@ -242,6 +242,10 @@ func KeepaliveEnforcementPolicy(kep keepalive.EnforcementPolicy) ServerOption {
// CustomCodec returns a ServerOption that sets a codec for message marshaling and unmarshaling.
//
// This will override any lookups by content-subtype for Codecs registered with RegisterCodec.
//
// Deprecated: server side codec can be registered, and it will be picked by the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecated: register codecs using encoding.RegisterCodec. The server will automatically use registered codecs based on the incoming requests' headers ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...see also <link>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@menghanl menghanl added the Type: Documentation Documentation or examples label Jun 18, 2020
@menghanl menghanl added this to the 1.31 Release milestone Jun 18, 2020
Copy link
Member

@dfawley dfawley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, travis is failing:

benchmark/worker/benchmark_server.go:126:24: grpc.CustomCodec is deprecated: register codecs using encoding.RegisterCodec. The server will automatically use registered codecs based on the incoming requests' headers. See also https://github.com/grpc/grpc-go/blob/master/Documentation/encoding.md#using-a-codec. (SA1019)

We could ignore these (especially if it's tests for this function) or fix the usages.

@dfawley dfawley assigned menghanl and unassigned dfawley Jun 25, 2020
@menghanl
Copy link
Contributor Author

I updated vet to ignore this. It was already ignoring other codec related deprecated APIs.

// Deprecated: register codecs using encoding.RegisterCodec. The server will
// automatically use registered codecs based on the incoming requests' headers.
// See also
// https://github.com/grpc/grpc-go/blob/master/Documentation/encoding.md#using-a-codec.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you look up & see whether this is something we must keep for 1.x or if it's something we may delete in the future? And add that to the comment here. (See other "deprecated" comments for examples.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. All deprecated APIs in this file were all available at GA.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

// Deprecated: register codecs using encoding.RegisterCodec. The server will
// automatically use registered codecs based on the incoming requests' headers.
// See also
// https://github.com/grpc/grpc-go/blob/master/Documentation/encoding.md#using-a-codec.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@menghanl menghanl merged commit c95dc4d into grpc:master Jun 26, 2020
@menghanl menghanl deleted the custom_codec_deprecated branch June 26, 2020 19:56
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Documentation Documentation or examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add grpc.ForceCodec-like ServerOption based on encoding.Codec
2 participants