From 6c70ffdcf6248f68d3c9c0b696c95772871b8674 Mon Sep 17 00:00:00 2001 From: Gyanendra Mishra Date: Thu, 9 May 2024 16:46:35 +0100 Subject: [PATCH] fix: set max receive size to 100Mb from 4Mb (#2442) Closes #2357 --- api/golang/engine/lib/kurtosis_context/kurtosis_context.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/golang/engine/lib/kurtosis_context/kurtosis_context.go b/api/golang/engine/lib/kurtosis_context/kurtosis_context.go index ed94156386..00df29f173 100644 --- a/api/golang/engine/lib/kurtosis_context/kurtosis_context.go +++ b/api/golang/engine/lib/kurtosis_context/kurtosis_context.go @@ -42,6 +42,8 @@ const ( defaultShouldAPICRunInDebugMode = false runAPICInDebugMode = true + + hundredMegabytes = 100 * 1024 * 1024 ) var ( @@ -72,7 +74,7 @@ func NewKurtosisContextFromLocalEngine() (*KurtosisContext, error) { kurtosisEngineSocketStr := fmt.Sprintf("%v:%v", localHostIPAddressStr, DefaultGrpcEngineServerPortNum) // TODO SECURITY: Use HTTPS to ensure we're connecting to the real Kurtosis API servers - conn, err := grpc.Dial(kurtosisEngineSocketStr, grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.Dial(kurtosisEngineSocketStr, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(hundredMegabytes))) if err != nil { return nil, stacktrace.Propagate( err, @@ -457,7 +459,7 @@ func newEnclaveContextFromEnclaveInfo( apiContainerHostMachineInfo.GrpcPortOnHostMachine, ) // TODO SECURITY: use HTTPS! - apiContainerConn, err := grpc.Dial(apiContainerHostMachineUrl, grpc.WithTransportCredentials(insecure.NewCredentials())) + apiContainerConn, err := grpc.Dial(apiContainerHostMachineUrl, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(hundredMegabytes))) if err != nil { return nil, stacktrace.Propagate(err, "An error occurred connecting to the API container on host machine URL '%v'", apiContainerHostMachineUrl) }