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

(low priority) core,netty,interop-testing: stabilize maxInboundMessageSize API #4399

Merged
merged 5 commits into from
Apr 27, 2018

Conversation

zpencer
Copy link
Contributor

@zpencer zpencer commented Apr 26, 2018

On server side, maxMessageSize is deprecated for
maxInboundMessageSize to match the channel builder.

Update usages to use new setter.

fixes #2563

@zpencer zpencer changed the title core,netty,interop-testing: stabilize maxInboundMessageSize API (low priority) core,netty,interop-testing: stabilize maxInboundMessageSize API Apr 27, 2018
@zpencer zpencer requested a review from ejona86 April 27, 2018 15:25
* @return this
* @throws IllegalArgumentException if max is negative.
Copy link
Member

Choose a reason for hiding this comment

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

s/max/bytes/

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

*
* @param bytes the maximum number of bytes a single message can be.
* @return this
* @throws IllegalArgumentException if max is negative.
Copy link
Member

Choose a reason for hiding this comment

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

s/max/bytes/

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

* @since 1.1.0
*/
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/2307")
public T maxInboundMessageSize(int max) {
public T maxInboundMessageSize(int bytes) {
// intentional nop
Copy link
Member

Choose a reason for hiding this comment

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

Probably should add in a checkArgument for bytes >= 0.

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

* @since 1.13.0
*/
public T maxInboundMessageSize(int bytes) {
throw new UnsupportedOperationException();
Copy link
Member

Choose a reason for hiding this comment

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

Client-side doesn't throw. Since this is advisory, that seems the better approach?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed and added comment.

public T maxInboundMessageSize(int max) {
// intentional nop
public T maxInboundMessageSize(int bytes) {
// intentional noop rather than throw, this method is only advisory.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you need to have both methods for a short time. We typically have one release with deprecation before removing it.

Also, this makes it easier to make internal users update before removal.

Copy link
Member

Choose a reason for hiding this comment

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

No methods were removed in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I just renamed max to bytes to be consistent.

@zpencer zpencer merged commit 9ada30b into grpc:master Apr 27, 2018
@zpencer zpencer deleted the stabilize-maxInboundMessageSize branch April 27, 2018 23:01
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking Issue for maxInboundMessageSize being Experimental
3 participants