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

Adding maxMessageSize config option #861

Closed
wants to merge 1 commit into from

Conversation

nmittler
Copy link
Member

Fixes #832

@nmittler
Copy link
Member Author

@ejona86 PTAL

@nmittler
Copy link
Member Author

From @carl-mastrangelo

According to the spec the max message size is an unsigned 4 byte, which is larger than an int.

Hmm ... I'm not sure we would ever want to support message sizes exceeding integer capacity. @louiscryan thoughts? Should we update the spec to be more clear?

@@ -129,6 +134,16 @@ public NettyChannelBuilder flowControlWindow(int flowControlWindow) {
return this;
}

/**
* Sets the maximum message size allowed to be received on the channel. If not called,
* defaults to 100 MiB.
Copy link
Member

Choose a reason for hiding this comment

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

Could the comment reference DEFAULT_MAX_MESSAGE_SIZE instead of hard-coding 100 MiB?

Copy link
Member

Choose a reason for hiding this comment

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

I guess not, because this is public.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that's why I hard-coded it :/

Copy link
Contributor

Choose a reason for hiding this comment

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

This class already has several imports referencing the internal package, why not just reference it in the javadoc?

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@ejona86
Copy link
Member

ejona86 commented Aug 24, 2015

@nmittler LGTM

The unsigned vs signed issue can be resolved later. We can change the int to long or similar if/when we support 4 GB messages.

@madongfly
Copy link
Contributor

Hmm, although I think the default 64MB limit should be enough for Android/Nano, I guess I'd better remove such limit to honor this PR?

@nmittler
Copy link
Member Author

@carl-mastrangelo @ejona86 I think I've address all of the comments. PTAL.

@@ -99,6 +99,11 @@
public static final String MESSAGE_ENCODING = "grpc-encoding";

/**
* The maximum uncompressed gRPC message size (in bytes). Defaults to 100 MiB.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is only for inbound messages right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Cleaned up the comment.

@nmittler
Copy link
Member Author

@ejona86 @carl-mastrangelo PTAL. I think I've addressed everything except support for maxMessageSize == 0.

@carl-mastrangelo
Copy link
Contributor

@nmittler LGTM

@nmittler
Copy link
Member Author

@ejona86 do you want to take another pass or shall I cherry-pick?

@ejona86
Copy link
Member

ejona86 commented Aug 26, 2015

@nmittler LGTM

@nmittler
Copy link
Member Author

Cherry-picked as 15f02ba

@nmittler nmittler closed this Aug 26, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 22, 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.

None yet

4 participants