Skip to content

Turning the files API off also stops the sweep, so expired rows stay forever #1595

Open

Description

@peteski22

Problem

files_enabled gates the five /api/v1/files routes and the lifespan worker that reclaims expired and soft-deleted files: _start_file_sweeper in main.py returns None when the flag is off.

Expired and soft-deleted are not terminal states. The sweep is the only transition out of them: it removes the bytes and then the row. So turning the flag off on a deployment that already holds rows leaves those bytes and rows unreclaimed, and nothing says so.

files_sweep_interval_sec = 0 has the same effect, and its description says cleanup is then left to the operator. The files_enabled description mentions only the endpoints.

Decision

files_enabled turns off the surface only. The routes go off, but the sweep keeps running, because the deployment still owes the deletion it promised in each file's expiry. Only files_sweep_interval_sec = 0 stops the sweep, and its description already says cleanup is then the operator's.

The name files_enabled reads as the whole capability. Rename it to say it gates the API surface, such as files_api_enabled, and accept the old name as a deprecated alias that logs once at startup.

A deployment that starts with the sweep not running and reclaimable rows present logs once that nothing will reclaim them.

Done when

  • With the flag off, the routes answer as disabled and the sweep still runs.
  • The flag is renamed, the old name is a deprecated alias, and the settings description says it gates the API surface only.
  • A deployment holding reclaimable rows with the sweep not running says so at startup.

Activity

  1. changed the title [-]Turning the files surface off also stops the sweep, so expired rows stay forever[/-] [+]Turning the files API off also stops the sweep, so expired rows stay forever[/+] on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/backendBackend service implementationtype/tech-debtMaintenance and cleanup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions