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

Reuse client option to configure server recv limit #654

Merged
merged 3 commits into from
Feb 17, 2020
Merged

Reuse client option to configure server recv limit #654

merged 3 commits into from
Feb 17, 2020

Conversation

itwalton
Copy link
Contributor

Motivation

Tried using the backend_max_call_recv_msg_size arg to send 5Mb message from browser front-end -> grpcwebproxy -> backend service. Proxy was throwing error (below). It looked like the server was still using the GRPC default message size of 4Mb.

Changes

  1. Apply existing CLI arg backend_max_call_recv_msg_size to proxy server

Verification

Setup

  • Go version: go version go1.13.4 darwin/amd64
  • OS: macOS
message UploadRequest {
  bytes file = 1;
}

message FooService {
  rpc Upload (UploadRequest) returns (...) {}
}

// create client
 const grpcClient = new FooServiceDefinition('localhost:8443', {
    transport: grpc.WebsocketTransport()
  })

Steps to reproduce

  1. Run proxy, built from source, with command $GOPATH/bin/grpcwebproxy --backend_max_call_recv_msg_size=5242880 --backend_addr=localhost:50053 --server_http_debug_port=8443 --run_tls_server=false --use_websockets --allow_all_origins

  2. Call grpcClient.upload w/ 5Mb request; received error:

ERRO[0026] finished streaming call with code Internal error="rpc error: code = Internal desc = failed proxying s2c: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (5242880 vs. 4194304)" grpc.code=Internal grpc.method=Upload grpc.service=FooService ...

  1. Build w/ fix; request successful

Copy link
Contributor

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

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

Nice, yeah, I think this makes sense, I imagine you always want the server and client limit to be matching up in this case.

@itwalton
Copy link
Contributor Author

Apologies for neglecting the tests. Will fix tonight.

@johanbrandhorst
Copy link
Contributor

Apologies for neglecting the tests. Will fix tonight.

I think this is a flake. Let me rerun it.

@johanbrandhorst johanbrandhorst merged commit 817faf5 into improbable-eng:master Feb 17, 2020
@johanbrandhorst
Copy link
Contributor

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants