Skip to content

Commit 43d7c47

Browse files
authored
Bump grpc message size limits. (#231)
* Update message length and connection settings * Bump version to 11.7.8 * fix lint
1 parent 466b009 commit 43d7c47

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

clarifai_grpc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "11.7.7"
1+
__version__ = "11.7.8"
22

33
import os
44

clarifai_grpc/channel/clarifai_channel.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
from clarifai_grpc.channel.grpc_json_channel import GRPCJSONChannel
77

88
RETRIES = 2 # if connections fail retry a couple times.
9-
CONNECTIONS = 20 # number of connections to maintain in pool.
10-
MAX_MESSAGE_LENGTH = 128 * 1024 * 1024 # 128MB
9+
CONNECTIONS = (
10+
20 # number of connections to maintain in pool, only usd for json channel, not direct GRPC.
11+
)
12+
MAX_MESSAGE_LENGTH = 1024 * 1024 * 1024 # 1GB
1113

1214
wrap_response_deserializer = None
1315

@@ -87,6 +89,7 @@ def get_grpc_channel(base=None, root_certificates_path=None):
8789
options=[
8890
("grpc.service_config", grpc_json_config),
8991
("grpc.max_receive_message_length", MAX_MESSAGE_LENGTH),
92+
("grpc.max_send_message_length", MAX_MESSAGE_LENGTH),
9093
],
9194
)
9295

@@ -108,6 +111,7 @@ def get_insecure_grpc_channel(base=None, port=18080):
108111
options=[
109112
("grpc.service_config", grpc_json_config),
110113
("grpc.max_receive_message_length", MAX_MESSAGE_LENGTH),
114+
("grpc.max_send_message_length", MAX_MESSAGE_LENGTH),
111115
],
112116
)
113117

@@ -136,6 +140,7 @@ def get_aio_grpc_channel(base=None, root_certificates_path=None):
136140
options=[
137141
("grpc.service_config", grpc_json_config),
138142
("grpc.max_receive_message_length", MAX_MESSAGE_LENGTH),
143+
("grpc.max_send_message_length", MAX_MESSAGE_LENGTH),
139144
],
140145
)
141146

@@ -157,5 +162,6 @@ def get_aio_insecure_grpc_channel(base=None, port=18080):
157162
options=[
158163
("grpc.service_config", grpc_json_config),
159164
("grpc.max_receive_message_length", MAX_MESSAGE_LENGTH),
165+
("grpc.max_send_message_length", MAX_MESSAGE_LENGTH),
160166
],
161167
)

0 commit comments

Comments
 (0)