Skip to content

fix: raise gRPC client/server message limits on sbom-scanner sidecar channel#842

Merged
matthyx merged 1 commit into
mainfrom
fix-grpc-message-size-limit
Jun 25, 2026
Merged

fix: raise gRPC client/server message limits on sbom-scanner sidecar channel#842
matthyx merged 1 commit into
mainfrom
fix-grpc-message-size-limit

Conversation

@matthyx

@matthyx matthyx commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Description

This PR resolves the issue where scanning larger images (such as wordpress:6.0.1-php7.4) fails because the generated SBOM size exceeds the default gRPC message size limit of 4 MiB on the client-side/server-side communication channel with sbom-scanner sidecar.

We raise the default message size limit on both ends to 128 MiB (128 * 1024 * 1024 bytes) to safely accommodate larger SBOM payloads.

This is the equivalent of kubescape/kubevuln#382 and references kubescape/kubevuln#381.

Changes

  • v1 Package (pkg/sbomscanner/v1/client.go):
    • Defined MaxgRPCMessageSize = 128 * 1024 * 1024.
    • Added grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(MaxgRPCMessageSize), grpc.MaxCallSendMsgSize(MaxgRPCMessageSize)) to grpc.NewClient.
  • Server Runner (pkg/sbomscanner/v1/run.go):
    • Configured grpc.NewServer with grpc.MaxRecvMsgSize(MaxgRPCMessageSize) and grpc.MaxSendMsgSize(MaxgRPCMessageSize).
  • Tests (pkg/sbomscanner/v1/integration_test.go and pkg/sbomscanner/v1/server_test.go):
    • Updated test gRPC servers and clients to also use MaxgRPCMessageSize call and server options.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@matthyx, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 21 minutes and 4 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fd7d2bcc-b622-4689-a023-0ccd33d57795

📥 Commits

Reviewing files that changed from the base of the PR and between d4c012f and 4006ca4.

📒 Files selected for processing (4)
  • pkg/sbomscanner/v1/client.go
  • pkg/sbomscanner/v1/integration_test.go
  • pkg/sbomscanner/v1/run.go
  • pkg/sbomscanner/v1/server_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-grpc-message-size-limit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…channel

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
@matthyx matthyx force-pushed the fix-grpc-message-size-limit branch from 24cf85e to 4006ca4 Compare June 25, 2026 12:59
@github-actions

Copy link
Copy Markdown

Performance Benchmark Results

Node-Agent Resource Usage
Metric BEFORE AFTER Delta
Avg CPU (cores) 0.000 0.000 N/A
Peak CPU (cores) 0.000 0.000 N/A
Avg Memory (MiB) 0.000 0.000 N/A
Peak Memory (MiB) 0.000 0.000 N/A
Dedup Effectiveness

No data available.

@matthyx matthyx added the release Create release label Jun 25, 2026
@github-actions

Copy link
Copy Markdown

Performance Benchmark Results

Node-Agent Resource Usage
Metric BEFORE AFTER Delta
Avg CPU (cores) 0.203 0.208 +2.6%
Peak CPU (cores) 0.211 0.218 +3.1%
Avg Memory (MiB) 317.680 311.939 -1.8%
Peak Memory (MiB) 320.430 316.637 -1.2%
Dedup Effectiveness

No data available.

@matthyx matthyx merged commit 6a05130 into main Jun 25, 2026
29 checks passed
@matthyx matthyx deleted the fix-grpc-message-size-limit branch June 25, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release Create release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants