Skip to content

feat(seaweedfs): limit single PUT request size to 5GB - #2414

Merged
Aleksei Sviridkin (lexfrei) merged 2 commits into
mainfrom
feat/seaweedfs-limit-put-request-size
Apr 30, 2026
Merged

Aleksei Sviridkin (lexfrei) merged 2 commits into
mainfrom
feat/seaweedfs-limit-put-request-size

Conversation

@IvanHunters

@IvanHunters IvanHunters commented Apr 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Limit single PUT request body size to 5GB for SeaweedFS S3 endpoints to enforce multipart upload usage for large files.

Motivation

Large monolithic file uploads via single PUT requests (files >5GB) frequently cause issues in production environments:

  • Connection timeouts during long uploads
  • Memory pressure on proxy/gateway components
  • Incomplete uploads resulting in corrupted data
  • High support load from users experiencing these failures

AWS S3 and other object storage providers recommend using multipart uploads for files larger than 100MB, with multipart being mandatory for files >5GB.

Changes

  • Set nginx.ingress.kubernetes.io/proxy-body-size: "5g" in system SeaweedFS configuration
  • Set nginx.ingress.kubernetes.io/proxy-body-size: "5g" in tenant SeaweedFS template (hardcoded, non-overridable)
  • Add explanatory comments documenting the limitation and rationale

Impact

For users:

  • Single PUT requests are limited to 5GB maximum
  • Files >5GB must be uploaded using S3 multipart upload API
  • All standard S3 clients (aws-cli, boto3, MinIO client, etc.) automatically use multipart for large files
  • No breaking changes for properly configured S3 clients

Platform benefits:

  • Reduced support load from large file upload failures
  • Better resource utilization (memory, connections)
  • More reliable upload experience for end users
  • Aligns with industry best practices (AWS, MinIO, etc.)

Testing

  • Verify small files (<5GB) upload successfully via PUT
  • Verify large files (>5GB) via PUT return HTTP 413
  • Verify multipart upload works for any file size
  • Test with common S3 clients (aws-cli, s3cmd, etc.)

Summary by CodeRabbit

  • Chores
    • Updated SeaweedFS S3 ingress configuration to enforce a 5GB maximum for single requests; files larger than 5GB should use multipart upload.
    • Disabled response/request buffering and extended NGINX timeouts, and enabled upstream service handling to improve reliability of large uploads and long-lived connections.

Add nginx ingress annotation to limit single PUT request body size to 5GB
for both system and tenant SeaweedFS S3 endpoints. This enforces the use
of S3 multipart upload API for files larger than 5GB, which prevents
issues commonly seen with large monolithic uploads and reduces support load.

Changes:
- Set proxy-body-size to "5g" in system seaweedfs values.yaml
- Set proxy-body-size to "5g" in tenant seaweedfs template
- Add explanatory comments for the limitation

Signed-off-by: IvanHunters <[email protected]>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.

Once credits are available, reopen this pull request to trigger a review.

@dosubot dosubot Bot added the size/XS This PR changes 0-9 lines, ignoring generated files label Apr 16, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a hard limit on the size of single PUT requests handled by SeaweedFS S3 endpoints. By restricting individual uploads to 5GB, the change forces the use of multipart uploads for larger files, which mitigates common issues such as connection timeouts, memory pressure, and data corruption. This adjustment aligns the platform with standard object storage practices and improves overall reliability for end users.

Highlights

  • Request Size Limitation: Implemented a 5GB limit on single PUT requests for SeaweedFS S3 endpoints to improve system stability.
  • Multipart Upload Enforcement: Configured Nginx ingress annotations to require multipart uploads for files exceeding the 5GB threshold.
  • Documentation: Added explanatory comments in configuration templates to clarify the rationale behind the new size constraint.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@coderabbitai

coderabbitai Bot commented Apr 16, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c3ddc591-d027-4628-873b-781c4e7d2e35

📥 Commits

Reviewing files that changed from the base of the PR and between 36814f6 and 355fd1d.

📒 Files selected for processing (1)
  • packages/extra/seaweedfs/templates/seaweedfs.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/extra/seaweedfs/templates/seaweedfs.yaml

📝 Walkthrough

Walkthrough

Two SeaweedFS Helm/Kubernetes ingress configuration files were updated: the NGINX proxy-body-size was changed from "0" to "5g", and several NGINX ingress annotations (buffering, timeouts, service-upstream) plus explanatory comments for the 5GB per-request multipart guidance were added/adjusted.

Changes

Cohort / File(s) Summary
SeaweedFS S3 Ingress templates
packages/extra/seaweedfs/templates/seaweedfs.yaml, packages/system/seaweedfs/values.yaml
Changed nginx.ingress.kubernetes.io/proxy-body-size from "0" to "5g"; added explanatory template comments about the 5GB single-request limit and multipart uploads; added/modified NGINX ingress annotations: proxy-buffering: "off", proxy-request-buffering: "off", extended timeouts (proxy-read-timeout, proxy-send-timeout, client-body-timeout, client-header-timeout), and enabled service-upstream: "true". Existing ingress wiring (backend-protocol, TLS, host, ingress-class, ACME solver selection) unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰🌿 I nibbled the config, made a tiny tweak,
Five gigs now fit where zero once did speak.
Split big uploads into multipart art,
My hops kept the ingress humming — smart! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat(seaweedfs): limit single PUT request size to 5GB' directly and clearly summarizes the main change: limiting single PUT request body size to 5GB for SeaweedFS S3 endpoints, which is the core objective of this pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/seaweedfs-limit-put-request-size

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.

@dosubot dosubot Bot added the kind/feature Categorizes issue or PR as related to a new feature label Apr 16, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the SeaweedFS ingress configuration in both the extra and system packages, changing the proxy-body-size from unlimited to 5GB to enforce multipart uploads for large files. Feedback includes a recommendation to align the extra package's ingress annotations with the system package by adding buffering and timeout settings, and to move these hardcoded template values into values.yaml according to the project style guide. Additionally, the PR needs to be updated to include a mandatory release-note block in the description and ensure all commits follow the Conventional Commits format with a Signed-off-by: trailer.

Comment on lines +243 to +246
# Limit single PUT request to 5GB to enforce multipart uploads for large files.
# This prevents issues with large file uploads and reduces support load.
# For files >5GB, clients must use S3 multipart upload API.
nginx.ingress.kubernetes.io/proxy-body-size: "5g"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

To fully address the issues mentioned in the PR motivation (connection timeouts and memory pressure), the tenant ingress should also include annotations to disable request buffering and increase timeouts, matching the configuration in the system SeaweedFS. Additionally, per the project style guide, configuration-level changes should ideally be defined in the package root values.yaml rather than hardcoded in the template, which would also allow users to override these values if necessary.

            # Limit single PUT request to 5GB and optimize for large uploads.
            # This prevents issues with large file uploads and reduces support load.
            # For files >5GB, clients must use S3 multipart upload API.
            nginx.ingress.kubernetes.io/proxy-body-size: "5g"
            nginx.ingress.kubernetes.io/proxy-buffering: "off"
            nginx.ingress.kubernetes.io/proxy-request-buffering: "off"
            nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
            nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
            nginx.ingress.kubernetes.io/client-body-timeout: "3600"
            nginx.ingress.kubernetes.io/client-header-timeout: "120"
            nginx.ingress.kubernetes.io/service-upstream: "true"
References
  1. For configuration-level changes: suggest overrides in the package root values.yaml. (link)

host: "seaweedfs.demo.cozystack.io"
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: "0"
# Limit single PUT request to 5GB to enforce multipart uploads for large files.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

The PR body is missing a release-note block, which is required by the project guidelines. Please add a block following the format: release-note\ntype(scope): human-readable changelog entry\n. Also, ensure all commits follow the Conventional Commits format and have a Signed-off-by: trailer.

References
  1. PR body must contain a release note block. (link)
  2. Each commit must follow Conventional Commits format and have a Signed-off-by: trailer. (link)

Align tenant SeaweedFS S3 ingress annotations with system configuration
by adding proxy buffering, request buffering, and timeout settings.
This ensures consistent handling of large file uploads and prevents
connection timeout issues for tenant buckets.

Changes:
- Add proxy-buffering and proxy-request-buffering annotations
- Add proxy-read-timeout, proxy-send-timeout timeouts (3600s)
- Add client-body-timeout and client-header-timeout settings
- Add service-upstream annotation for load balancing

Signed-off-by: IvanHunters <[email protected]>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — small, well-scoped enforcement of the S3 single-PUT 5GB cap, with the tenant ingress brought into parity with the existing system annotation set.

Business context: SeaweedFS S3 endpoints currently accept unlimited single-PUT bodies (proxy-body-size: "0"), which leads to long-running uploads, memory pressure, and connection timeouts; this PR caps single PUTs at 5GB to push large uploads to multipart, matching AWS S3 semantics.

Non-blocking follow-ups

  1. The PR body has no release-note block, which the project's pull-request template marks as expected. The PR title is descriptive enough to serve as the changelog entry, but filling in an explicit release-note ... block keeps the auto-generated changelog clean.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 29, 2026
@lexfrei
Aleksei Sviridkin (lexfrei) merged commit 0aed318 into main Apr 30, 2026
9 checks passed
@lexfrei
Aleksei Sviridkin (lexfrei) deleted the feat/seaweedfs-limit-put-request-size branch April 30, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature lgtm This PR has been approved by a maintainer size/XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants