Skip to content

Restore bulk_jobs body limit in live router#248

Merged
nkeilbart merged 2 commits intomainfrom
247-fix-large-torc-submit
Apr 7, 2026
Merged

Restore bulk_jobs body limit in live router#248
nkeilbart merged 2 commits intomainfrom
247-fix-large-torc-submit

Conversation

@nkeilbart
Copy link
Copy Markdown
Collaborator

Summary

Restore the larger request-body limit for /torc-service/v1/bulk_jobs
in the Axum live router.

This fixes a regression where torc submit could fail on large
parameterized workflows with:

413 Failed to buffer the request body: length limit exceeded

The change applies the larger body limit only to /bulk_jobs, while
leaving the default Axum body limit in place for other routes.

Changes

  • reintroduce a /bulk_jobs-specific request body limit in
    src/server/live_router.rs
  • keep the default limit for non-bulk routes
  • restore support for TORC_MAX_REQUEST_BODY_MB
  • add router regression tests covering:
    • large JSON requests accepted on /bulk_jobs
    • large JSON requests still rejected on a non-bulk JSON endpoint

Verification

  • cargo fmt -- --check
  • dprint check
  • DATABASE_URL=sqlite:db/sqlite/dev.db cargo clippy --all --all-targets --all-features -- -D warnings
  • SQLX_OFFLINE=true cargo test bulk_jobs_route_accepts_body_larger_than_default_limit --features openapi-codegen
  • SQLX_OFFLINE=true cargo test non_bulk_json_route_still_uses_default_body_limit --features openapi-codegen

Reapply the large request-body limit to /bulk_jobs in the Axum\nrouter while leaving default limits in place for the rest of\nthe API.\n\nAdd router tests covering both the large bulk-jobs request path\nand the default-limit behavior on a non-bulk JSON endpoint.
@nkeilbart nkeilbart requested a review from daniel-thom April 4, 2026 05:52
@nkeilbart
Copy link
Copy Markdown
Collaborator Author

This fix works now on Perlmutter. I am able to submit my jobs and have it do it in 10k batches. There is another issue I'll open about the GPUs. I still don't think they are working correctly.

Copy link
Copy Markdown
Collaborator

@daniel-thom daniel-thom left a comment

Choose a reason for hiding this comment

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

Thanks for finding and fixing the bug.

Comment thread src/server/live_router.rs
Comment thread src/server/live_router.rs Outdated
Comment thread src/server/live_router.rs
Rename the bulk upload body-limit helper and constant so their
scope is explicit in the live router.

Document the Axum 2 MiB default and the
TORC_MAX_REQUEST_BODY_MB override in the server docs so PR
feedback is resolved without changing route behavior.
Copy link
Copy Markdown
Collaborator

@daniel-thom daniel-thom left a comment

Choose a reason for hiding this comment

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

LGTM

@nkeilbart nkeilbart merged commit 2860a19 into main Apr 7, 2026
9 checks passed
@nkeilbart nkeilbart deleted the 247-fix-large-torc-submit branch April 7, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants