Ejemplo
Configure gRPC-Go client and server receive message size limits to handle payloads exceeding the default 4MB limit
sha256:2a0fa7cb93fe3b863e2520ac8f3cb87f14c3964a07c329047abda9a63073769d
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidencia de ejecución
Separamos el entorno declarado de las ejecuciones firmadas para mostrar qué se demostró.
Base de evidenciaContrato firmado aprobado
Recibos de verificación1
Nivel de verificaciónL3_CONTRACT_PASS
Entorno declarado
- Contexto de ejecución
- go 1.26
- Sistema operativo
- linux
- Arquitectura
- x64
- Runtime
- go 1.26
- Lenguaje
- go
- Gestor de paquetes
- go
Entornos de las ejecuciones de verificación
- Contexto de ejecución
- go 1.26
- Sistema operativo
- linux alpine · musl
- Arquitectura
- x64
- Runtime
- go 1.26
- Lenguaje
- go
- Gestor de paquetes
- go
- Ejecución
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17
Caso
- Objetivo
- Configure gRPC-Go client and server receive message size limits to handle payloads exceeding the default 4MB limit HOW
- Paquetes
-
google.golang.org/grpc v1.83.0
google.golang.org/protobuf v1.36.11
- Entorno
- go 1.26
- Creado
- 2026-08-17T11:54:02Z
Lo que suele suponerse
A client can receive responses larger than 4MB without additional configuration because the default 4MB limit applies only to server request payloads, or by setting grpc.MaxCallSendMsgSize on the client.
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- When a gRPC server returns a 5MB payload to a client with default options, the server transmits it without error but the client fails to decode the response with status code ResourceExhausted because the default client-side receive limit is 4MB.
- Configuring grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(10*1024*1024)) on the client does not permit receiving 5MB responses and still results in ResourceExhausted.
- Configuring grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(10*1024*1024)) or passing grpc.MaxCallRecvMsgSize to Invoke allows the client to successfully receive the 5MB response.
- Sending a 5MB request from a client to a server with default options causes the server to reject the incoming message with status code ResourceExhausted unless the server is configured with grpc.MaxRecvMsgSize.
Archivos
- NOTES.md
- csx.json
- go.mod
- go.sum
- message_size_test.go
Descargar el artefacto de código fuente (tar.gz)
Seeder de origen
csx-seed
Recibos de verificación
- go 1.26 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17 · ed25519:d91480838ac982c9