Skip to content

Commit

Permalink
Add two new grpc config values: max_send_message_length and max_recei…
Browse files Browse the repository at this point in the history
…ve_message_length
  • Loading branch information
burmanm committed Oct 26, 2023
1 parent db75271 commit bf78e4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion medusa/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

GrpcConfig = collections.namedtuple(
'GrpcConfig',
['enabled']
['enabled', 'max_send_message_length', 'max_receive_message_length']
)

KubernetesConfig = collections.namedtuple(
Expand Down Expand Up @@ -161,6 +161,8 @@ def _build_default_config():

config['grpc'] = {
'enabled': 'False',
'max_send_message_length': '536870912',
'max_receive_message_length': '134217728',
}

config['kubernetes'] = {
Expand Down
5 changes: 4 additions & 1 deletion medusa/service/grpc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ def __init__(self, config_file_path, testing=False):
self.config_file_path = config_file_path
self.medusa_config = self.create_config()
self.testing = testing
self.grpc_server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
self.grpc_server = grpc.server(futures.ThreadPoolExecutor(max_workers=10), options = [
('grpc.max_send_message_length', self.medusa_config.grpc.max_send_message_length),
('grpc.max_receive_message_length', self.medusa_config.grpc.max_receive_message_length)
])
logging.info("GRPC server initialized")

def shutdown(self, signum, frame):
Expand Down

0 comments on commit bf78e4e

Please sign in to comment.