Skip to content

Commit

Permalink
fix: remove client recv msg limit (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
busunkim96 authored Dec 10, 2020
1 parent f28b43d commit 80147ce
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ class {{ service.name }}GrpcTransport({{ service.name }}Transport):
ssl_credentials=ssl_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
self._ssl_channel_credentials = ssl_credentials
else:
Expand All @@ -138,6 +142,10 @@ class {{ service.name }}GrpcTransport({{ service.name }}Transport):
credentials=credentials,
ssl_credentials=ssl_channel_credentials,
scopes=self.AUTH_SCOPES,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)

self._stubs = {} # type: Dict[str, Callable]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,10 @@ def test_{{ service.name|snake_case }}_transport_channel_mtls_with_client_cert_s
),
ssl_credentials=mock_ssl_cred,
quota_project_id=None,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
assert transport.grpc_channel == mock_grpc_channel
assert transport._ssl_channel_credentials == mock_ssl_cred
Expand Down Expand Up @@ -787,6 +791,10 @@ def test_{{ service.name|snake_case }}_transport_channel_mtls_with_adc(
),
ssl_credentials=mock_ssl_cred,
quota_project_id=None,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
assert transport.grpc_channel == mock_grpc_channel

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ class {{ service.name }}GrpcTransport({{ service.name }}Transport):
ssl_credentials=ssl_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
self._ssl_channel_credentials = ssl_credentials
else:
Expand All @@ -148,6 +152,10 @@ class {{ service.name }}GrpcTransport({{ service.name }}Transport):
ssl_credentials=ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)

self._stubs = {} # type: Dict[str, Callable]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ class {{ service.grpc_asyncio_transport_name }}({{ service.name }}Transport):
ssl_credentials=ssl_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
self._ssl_channel_credentials = ssl_credentials
else:
Expand All @@ -192,6 +196,10 @@ class {{ service.grpc_asyncio_transport_name }}({{ service.name }}Transport):
ssl_credentials=ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)

# Run the base constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ class {{ service.name }}RestTransport({{ service.name }}Transport):
self._host,
credentials=self._credentials,
scopes=self.AUTH_SCOPES,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,10 @@ def test_{{ service.name|snake_case }}_transport_channel_mtls_with_client_cert_s
),
ssl_credentials=mock_ssl_cred,
quota_project_id=None,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
assert transport.grpc_channel == mock_grpc_channel
assert transport._ssl_channel_credentials == mock_ssl_cred
Expand Down Expand Up @@ -1276,6 +1280,10 @@ def test_{{ service.name|snake_case }}_transport_channel_mtls_with_adc(
),
ssl_credentials=mock_ssl_cred,
quota_project_id=None,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
assert transport.grpc_channel == mock_grpc_channel

Expand Down

0 comments on commit 80147ce

Please sign in to comment.