Skip to content

fix: avoid preallocating large buffers for small uploads#80

Merged
PranavAgarkar07 merged 1 commit into
PranavAgarkar07:mainfrom
mittalsonal:codex/beamsync-small-upload-buffer-50
Jun 17, 2026
Merged

fix: avoid preallocating large buffers for small uploads#80
PranavAgarkar07 merged 1 commit into
PranavAgarkar07:mainfrom
mittalsonal:codex/beamsync-small-upload-buffer-50

Conversation

@mittalsonal

Copy link
Copy Markdown
Contributor

Summary

  • remove the unconditional 64MB bytes.Buffer preallocation for regular uploads
  • size the initial upload buffer from manifest, multipart, or request size hints when available
  • keep large uploads capped at the existing 64MB dispatch threshold and let unknown-size uploads grow naturally
  • add focused tests for small manifest sizing, large-size capping, request-length fallback, and unknown large uploads

Validation

  • git diff --check

Note: Go tooling is not installed in this environment (go/gofmt are unavailable on PATH), so I could not run local Go tests or formatting. GitHub CI should run the Go checks.

Closes #50

Signed-off-by: Garima Varshney <gungunvarshney00@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

More reviews will be available in 52 minutes and 53 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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f46ddd26-1f61-4cdc-9669-3fd2dbc41e9a

📥 Commits

Reviewing files that changed from the base of the PR and between be465d0 and ceb6e56.

📒 Files selected for processing (2)
  • beamsync/server.go
  • beamsync/server_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@PranavAgarkar07 PranavAgarkar07 added bug Something isn't working gssoc:approved Approved for GSSoC contributions level:advanced Advanced level task type:performance Performance labels Jun 17, 2026
@PranavAgarkar07 PranavAgarkar07 merged commit 4fc1ddb into PranavAgarkar07:main Jun 17, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working gssoc:approved Approved for GSSoC contributions level:advanced Advanced level task type:performance Performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [Bug] Every file gets a 64MB memory allocation — even 1KB ones

3 participants