Skip to content

push and pull leave their temporary files on disk after they return #492

Description

@morphqdd

push (lib/baza-rb.rb:122) and pull (:148) use Tempfile.open do |file| ... end. The block form closes the file at the end of the block but does not unlink it; removal waits for the finalizer.

What happens: the payload here is a factbase, so each surviving file is the full size of the data pushed or pulled, and a long-running process accumulates them.

temp file used during push: /tmp/.../20260925-3436721-oer4c0
still on disk right after push returned? true (1000 bytes)

after 10 pushes of 500kB: 6 files, 3000000 bytes on disk
after GC.start x2: 0 files
after 5 Tempfile.create: 0 files

pull behaves the same way: ten pulls of a 200 kB body left seven files and 1,400,000 bytes behind.

What should happen: use Tempfile.create, whose block form removes the file when the block exits, so the copy is gone by the time the method returns.

No activity

Activity on this issue will appear here.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions