Skip to content

Close temporary clip upload files on every server error path #9

Description

@Luqueee

Problem

In internal/clip/server.go:103-132, the temporary upload file is not closed before returning a 413 MaxBytesError.

Repeated oversized uploads can exhaust file descriptors over the lifetime of the clip server.

Acceptance criteria

  • Close the temporary file on every path, including 413, copy failure, close failure, and rename failure.
  • Keep cleanup idempotent and avoid double-close assumptions.
  • Preserve atomic publication and temporary-file removal.
  • Add a regression test that exercises repeated oversized uploads and verifies no descriptor growth or stale open files.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions