-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Conversation
On server side, `maxMessageSize` is deprecated for `maxInboundMessageSize` to match the channel builder. Update usages to use new setter.
* @return this | ||
* @throws IllegalArgumentException if max is negative. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/max/bytes/
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/max/bytes/
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
On server side,
maxMessageSize
is deprecated formaxInboundMessageSize
to match the channel builder.Update usages to use new setter.
fixes #2563