fix(flow): raise Core gRPC receive limit - #5448
Conversation
Expected-inventory RPCs return complete snapshots and can exceed grpc-go's 4 MiB default receive limit. Configure Flow's Core client with the same 32 MiB ceiling used by site-workflow. Cover the transport boundary with a response that the default client rejects but the Flow client accepts. Signed-off-by: Kun Zhao <kunzhao@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. Summary by CodeRabbit
WalkthroughThe Core gRPC client now accepts responses up to 32 MiB. Shared dial options preserve TLS credentials and the unary interceptor. A transport test validates rejection at the default limit and successful receipt of a large inventory with Flow’s options. ChangesCore gRPC transport
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR raises Flow’s Core gRPC receive limit to support larger expected-inventory responses; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd7b0a3a1e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return s.response, nil | ||
| } | ||
|
|
||
| func TestCoreGRPCDialOptionsReceiveExpectedInventory(t *testing.T) { |
There was a problem hiding this comment.
Name the test after coreGRPCDialOptions
This test exercises the newly added coreGRPCDialOptions helper, but its top-level name adds a scenario-specific suffix instead of using the required Test<Function> form. Rename it to TestCoreGRPCDialOptions and retain the existing cases as named t.Run subtests so future scenarios for this helper remain grouped under the same function-level test.
AGENTS.md reference: rest-api/AGENTS.md:L193-L197
Useful? React with 👍 / 👎.
🔐 TruffleHog Secret Scan✅ No secrets or credentials found! Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉 🕐 Last updated: 2026-08-27 07:26:54 UTC | Commit: cd7b0a3 |
Flow's Core client currently uses grpc-go's default 4 MiB receive limit. Core's expected machine, rack, switch, and power-shelf RPCs each return a complete collection in one unary response, so a larger site can exceed that limit. The RPC then fails with
ResourceExhausted, and Flow cannot refresh that resource type.This change sets a 32 MiB receive ceiling on Flow's Core client, matching the existing site-workflow setting. The limit applies to every Core response received through this client and allocates memory only as a response is received. A transport-level test proves that the old default rejects an expected-inventory response over 4 MiB while the Flow client accepts the complete response.
Related issues
Type of Change
Breaking Changes
Testing
Additional Notes
This is a short-term guard rather than the complete resolution of #4355. The issue remains open to define a bounded pagination or streaming contract for expected inventory above 32 MiB. Because the current RPCs are unary, an oversized or otherwise failed response is returned as an error and is not applied as a partial snapshot.
Verification:
go test -p 1 ./flow/... -count=1go test -race ./flow/internal/nicoapi -count=1go vet ./flow/internal/nicoapigo tool golangci-lint run --new-from-rev=origin/main ./flow/internal/nicoapimake lint-gopython3 scripts/check_source_headers.py