🧱 Chunk is a download manager for slow and unstable servers

A corrupt progress file permanently blocks future downloads #13

Open cuducos.me
Open opened by cuducos.me

Problem

progress.done writes via os.Create + gob encode — non-atomic, no fsync (progress.go:115-128). A crash mid-write leaves a truncated file, and load hard-fails on decode (progress.go:75-79) with no recovery path.

Impact

Every subsequent run for that URL dies until the user manually deletes the progress file.

Suggested fix

Write atomically (temp file + rename, optionally fsync), and/or delete-and-restart on decode failure.

Sign up or Sign in to add to the discussion.