From 152a3879636e045ae81c9f36cc763f19b26966c5 Mon Sep 17 00:00:00 2001 From: Alan Meadows Date: Tue, 27 Jun 2017 05:41:43 -0700 Subject: [PATCH] Increase gRPC message size defaults * Increase gRPC message size defaults The long term solution is better pagination when listing releases. This is a short-term fix that allows a larger message size as the 4MB built in gRPC default was being exhausted with just 10 releases. * Fix pep8 issues and define max value more clearly --- armada/handlers/tiller.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/armada/handlers/tiller.py b/armada/handlers/tiller.py index 221f5343..ad45197b 100644 --- a/armada/handlers/tiller.py +++ b/armada/handlers/tiller.py @@ -27,6 +27,13 @@ TILLER_VERSION = b'2.1.3' TILLER_TIMEOUT = 300 RELEASE_LIMIT = 64 +# the standard gRPC max message size is 4MB +# this expansion comes at a performance penalty +# but until proper paging is supported, we need +# to support a larger payload as the current +# limit is exhausted with just 10 releases +MAX_MESSAGE_LENGTH = 4010241024 + LOG = logging.getLogger(__name__) class Tiller(object): @@ -61,7 +68,13 @@ class Tiller(object): ''' tiller_ip = self._get_tiller_ip() tiller_port = self._get_tiller_port() - return grpc.insecure_channel('%s:%s' % (tiller_ip, tiller_port)) + return grpc.insecure_channel( + '%s:%s' % (tiller_ip, tiller_port), + options=[ + ('grpc.max_send_message_length', MAX_MESSAGE_LENGTH), + ('grpc.max_receive_message_length', MAX_MESSAGE_LENGTH) + ] + ) def _get_tiller_pod(self): '''