Skip to content

feat(server): stop uploads from filling the server's disk, and say so plainly to every client - #537

Merged
GeiserX merged 5 commits into
mainfrom
feat/server-free-space-floor
Nov 12, 2026
Merged

GeiserX merged 5 commits into
mainfrom
feat/server-free-space-floor

Conversation

@GeiserX

@GeiserX GeiserX commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Problem

A jobs key could fill the server's data volume. Nothing checked free space before or while an upload was written. The queue check cannot see uploads still arriving, and kept audio (keep_audio) is never swept. Once the disk is full, the job store and every other key stop working.

Fix

Every multipart upload now keeps 1 GB free on the volume of its upload folder. This is the same margin a model download keeps (SV-M2).

  • Under the floor, the server answers 507 insufficient_storage before it reads the body. The answer gives free_bytes and floor_bytes.
  • While the body arrives, the server checks again every 16 MB. If the volume falls under the floor, it cuts the upload and deletes the spool file. This catches parallel uploads that all passed the first check.
  • The forwarding primary reads a 507 as a refusal, the same as a 422. It does not mark the remote down and does not send the job again.
  • A dictation sent to a remote does not count a 507 toward the down-probe. It falls back with the notice remote disk full, used fast.
  • akou transcribe and akou_transcribe print the server's reason. The CLI exits 70, not 69 (unavailable).

Not in this change

  • A per-key cap on kept audio. It changes the SV-D5 contract and is still an open decision.
  • A separate CLI exit code for a full server disk.

Testing

  • New tests [DSK-F1] and [DSK-F2], also added to docs/TRAPS.md. They cover the refusal before the body, the cut mid-body with no file left, the OpenAI-compatible route, the CLI, the MCP tool, the forwarding primary and the dictation remote. The positive controls are the same upload with room, and a 503 that still counts as down.
  • Every new test fails on main. The two client tests also fail with the server floor in place and the old client code.
  • A cut 40 MB upload over HTTP still returns a readable 507 to the client. A loopback check with 2 to 300 MB bodies read the 507 every time, both when the answer came before the body and when it came mid-body.
  • check:static passes. The touched suites pass: multipart, upload floor, remote dispatch, dictation remote, jobs, OpenAI, Bazarr, upload idle, security, OpenAPI and docs.

A jobs key could fill the data volume with parallel uploads or kept audio:
nothing checked free space before or while an upload was written. Every
multipart upload now keeps the 1 GB a model download keeps, checked before
the first byte and every 16 MB while the body arrives.
…t is down

The forwarding primary read any 5xx as a remote that is down and sent the
job again; the dictation remote counted it toward its down-probe and said
the remote was down. A 507 now fails or keeps the job here like a 422, and
the dictation falls back saying the remote's disk is full.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between af3819c and 5ec6b90.

Files selected for processing: 15

  • docs/TRAPS.md
  • docs/api/openapi.json
  • src/main/api/errors.ts
  • src/main/api/multipart.ts
  • src/main/api/openapi.ts
  • src/main/api/routes/jobs.ts
  • src/main/api/server.ts
  • src/main/dictation/remote.ts
  • src/main/index.ts
  • src/main/server/jobs.ts
  • src/main/server/remotes.ts
  • tests/dictation-remote.e2e.test.ts
  • tests/multipart.test.ts
  • tests/remote-dispatch.e2e.test.ts
  • tests/upload-floor.e2e.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

…s it

A remote whose disk is under its floor is skipped for one probe period, so a job
it refused goes to the next remote that offers it instead of failing or running
here. With no other remote, the job still runs here or fails with the reason.
@GeiserX
GeiserX merged commit fd0dcb5 into main Nov 12, 2026
30 checks passed
@GeiserX
GeiserX deleted the feat/server-free-space-floor branch November 12, 2026 12:34
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.

1 participant