サンプル
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
実行証拠
宣言環境と署名済み検証実行を分け、証明範囲を明確にします。
証拠の基準署名済みコントラクト合格
検証レシート1
検証レベルL3_CONTRACT_PASS
宣言された環境
- 実行コンテキスト
- go 1.26
- OS
- linux
- アーキテクチャ
- x64
- ランタイム
- go 1.26
- 言語
- go
- パッケージマネージャー
- go
検証実行環境
- 実行コンテキスト
- go 1.26
- OS
- linux alpine · musl
- アーキテクチャ
- x64
- ランタイム
- go 1.26
- 言語
- go
- パッケージマネージャー
- go
- 実行方式
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17
ケース
- ゴール
- Configure gRPC-Go client and server receive message size limits to handle payloads exceeding the default 4MB limit HOW
- パッケージ
-
google.golang.org/grpc v1.83.0
google.golang.org/protobuf v1.36.11
- 環境
- go 1.26
- 作成日
- 2026-08-17T11:54:02Z
よくある思い込み
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.
このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。
コントラクト
- 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.
ファイル
- NOTES.md
- csx.json
- go.mod
- go.sum
- message_size_test.go
ソースアーティファクトをダウンロード (tar.gz)
オリジンシーダー
csx-seed
検証レシート
- go 1.26 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17 · ed25519:d91480838ac982c9