Skip to content

Tracking Issue for MetadataUtils being Experimental. #1789

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

Closed
carl-mastrangelo opened this issue May 3, 2016 · 9 comments · Fixed by #10443
Closed

Tracking Issue for MetadataUtils being Experimental. #1789

carl-mastrangelo opened this issue May 3, 2016 · 9 comments · Fixed by #10443
Labels
experimental API Issue tracks stabilizing an experimental API
Milestone

Comments

@carl-mastrangelo
Copy link
Contributor

Specific usages:

  • MetadataUtils.attachHeaders
  • MetadataUtils.captureMetadata
@carl-mastrangelo carl-mastrangelo added this to the Unscheduled milestone May 3, 2016
@ejona86 ejona86 added the experimental API Issue tracks stabilizing an experimental API label Aug 22, 2016
@dapengzhang0 dapengzhang0 modified the milestones: Next, Unscheduled Jan 19, 2017
@duelinmarkers
Copy link
Contributor

Should this apply to the other public methods in MetadataUtils (newAttachHeadersInterceptor and newCaptureMetadataInterceptor)?

@ejona86
Copy link
Member

ejona86 commented Nov 10, 2017

The two interceptors are stable. This only applies to the stub-modifying convenience methods (which explicitly reference this issue in their @ExperimentalApi annotation).

@benjaminp
Copy link
Contributor

Would it be possible to stabilize these now?

@ejona86
Copy link
Member

ejona86 commented Jul 30, 2021

I think I'm most tempted to delete them. The interceptors can be used from stubs as well, the interceptors fit better into the fluent configuration of stubs, and I don't think we really want people creating similar stub-accepting APIs as they will either only have the stub API or have to duplicate the API for interceptor as well.

The main benefit of these stub APIs is they have short method names. But nothing prevents us from having shorter names for the interceptor-based methods.

@ejona86
Copy link
Member

ejona86 commented Jul 30, 2021

(It is true they have existed for a long time and current users aren't really hurt by them. We should look into how often they are used and factor that in.)

@benjaminp
Copy link
Contributor

Deleting them is fine as far as I'm concerned. This just came up because I was telling someone on a review to use non-experimental newAttachHeadersInterceptor instead of attachHeaders. Then, I wondered if an consensus had emerged over the last 5 years.

@ejona86
Copy link
Member

ejona86 commented Jul 30, 2021

Okay, sounds good. I've added this to the "API review" meeting next Thursday to get input from more maintainers. These methods are very cheap to maintain, so I think it is a discussion about "what should 'normal' APIs for this sort of stuff look like."

To be clear: when I say "delete them", we'd do that slowly. We'd mark them @Deprecated and leave them for multiple releases (maybe quite a long time since they are cheap to maintain).

@ejona86
Copy link
Member

ejona86 commented Aug 5, 2021

API review:

  • The stub-based API is uglier to chain and doesn't really serve anybody better. We believe (but didn't verify) it was created before we had stub.withInterceptor(). Back in those days you had to do a stub.withChannel(ClientInterceptors.intercept(stub.getChannel(), interceptor)) dance.
  • +4 for deprecate+delete. +1 for no strong opinion

So I'll be marking this deprecated soon. And then it'll sit there for a year or more before deleting, because it has been there a long time and doesn't hurt much, especially if marked deprecated so people wouldn't copy the approach.

@ejona86
Copy link
Member

ejona86 commented Aug 5, 2021

One interesting detail I just noticed: this class is in stub but with the removal wouldn't actually depend on the stubs at all.

Looked it up: MetadataUtils actually predates ClientInterceptor itself, since we were using it to test Metadata and Metadata predated the ClientInterceptor convenience. We had the interceptor concept but it was "manually pass Channel into your interceptor's constructor and then delegate". ClientInterceptor came about 1.5 months later.

1369ea1
48e734d

ejona86 added a commit to ejona86/grpc-java that referenced this issue Aug 6, 2021
We don't want other APIs to copy the stub-based API to attach the
interceptor. The API has a shorter name, but isn't actually all that
easier to use and isn't fluent like using the interceptor API.

These are _very_ old methods, so we won't be quick to delete them. Seems
we should have them deprecated at least a year or two; they are easy to
maintain in the mean time.

See API Review notes in grpc#1789
ejona86 added a commit to ejona86/grpc-java that referenced this issue Aug 6, 2021
We don't want other APIs to copy the stub-based API to attach the
interceptor. The API has a shorter name, but isn't actually all that
easier to use and isn't fluent like using the interceptor API.

These are _very_ old methods, so we won't be quick to delete them. Seems
we should have them deprecated at least a year or two; they are easy to
maintain in the mean time.

See API Review notes in grpc#1789
ejona86 added a commit that referenced this issue Aug 6, 2021
We don't want other APIs to copy the stub-based API to attach the
interceptor. The API has a shorter name, but isn't actually all that
easier to use and isn't fluent like using the interceptor API.

These are _very_ old methods, so we won't be quick to delete them. Seems
we should have them deprecated at least a year or two; they are easy to
maintain in the mean time.

See API Review notes in #1789
@ejona86 ejona86 modified the milestones: Next, 1.58 Aug 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
experimental API Issue tracks stabilizing an experimental API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants