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
This commit is contained in:
Alan Meadows 2017-06-27 05:41:43 -07:00 committed by Alexis Rivera DeLa Torre
parent f6971ac9ff
commit 152a387963
1 changed files with 14 additions and 1 deletions

View File

@ -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):
'''