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

fix max msg size type issues on different arch #1623

Merged
merged 2 commits into from
Oct 26, 2017

Conversation

lyuxuan
Copy link
Contributor

@lyuxuan lyuxuan commented Oct 25, 2017

  • Allow service config msg size field to be in range int64.
  • On 32-bit machine, it will then be capped to int32

Value range:
32-bit system: User API: int32, Service Config: int32, Max allowed slice length: int32, Max by spec: uint32
64-bit system: User API: int64, Service Config: int64, Max allowed slice length: int64, Max by spec: uint32

@TrackClimbCom
Copy link

We need this pull request so much!

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.

Please fix the string first, thanks.

rpc_util.go Outdated
@@ -274,7 +274,10 @@ func (p *parser) recvMsg(maxReceiveMessageSize int) (pf payloadFormat, msg []byt
if length == 0 {
return pf, nil, nil
}
if length > uint32(maxReceiveMessageSize) {
if int64(length) > int64(maxInt) {
return 0, nil, Errorf(codes.ResourceExhausted, "grpc: received message larger than max length allowed on current machine(%d vs. %d)", length, maxInt)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: missing space before open paren in string.

@lyuxuan lyuxuan merged commit fe0602d into grpc:master Oct 26, 2017
@menghanl menghanl added this to the 1.8 Release milestone Nov 7, 2017
@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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants