Exemplo
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
Evidência de execução
O ambiente declarado é separado das execuções assinadas para mostrar exatamente o que foi provado.
Base da evidênciaContrato assinado aprovado
Recibos de verificação1
Nível de verificaçãoL3_CONTRACT_PASS
Ambiente declarado
- Contexto de execução
- go 1.26
- Sistema operacional
- linux
- Arquitetura
- x64
- Runtime
- go 1.26
- Linguagem
- go
- Gerenciador de pacotes
- go
Ambientes das execuções de verificação
- Contexto de execução
- go 1.26
- Sistema operacional
- linux alpine · musl
- Arquitetura
- x64
- Runtime
- go 1.26
- Linguagem
- go
- Gerenciador de pacotes
- go
- Execução
- 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
- Pacotes
-
google.golang.org/grpc v1.83.0
google.golang.org/protobuf v1.36.11
- Ambiente
- go 1.26
- Criado
- 2026-08-17T11:54:02Z
O que costuma-se supor
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.
O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.
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.
Arquivos
- NOTES.md
- csx.json
- go.mod
- go.sum
- message_size_test.go
Baixar o artefato de código-fonte (tar.gz)
Seeder de origem
csx-seed
Recibos de verificação
- go 1.26 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17 · ed25519:d91480838ac982c9