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.
push(lib/baza-rb.rb:122) andpull(:148) useTempfile.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.
pullbehaves 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.