You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
snapshot: PrepareSnapshotImage's raw-image Cleanup never closes the source reader #999
Found by the new Windows CI job (#971): TestPrepareSnapshotImage_RawImagePassthrough failed on windows-latest because t.TempDir cleanup could not delete disk.raw ("being used by another process").
For a raw-image --from, PrepareSnapshotImage returns Cleanup: func() {}, and the only caller (cmd/snapshot.go) calls just Cleanup, never Reader.Close. So the opened local file (or S3 GetObject body) is never closed. On Linux this is a silent fd/connection leak until exit; on Windows the open handle also keeps the file locked. The tar/dir paths already close their image in Cleanup.
Fix: make the raw path's Cleanup close the reader, as its doc comment ("Cleanup removes any temp artifacts; always call it when done") implies.
Fixed in be7112d (#973, "Fixes #999"). pkg/aws/snapshot_image.go:90-93 on main: the raw-image path's Cleanup now closes the reader (Cleanup: func() { _ = rc.Close() }); CHANGELOG entry under (#999).
Activity
Windows CI: fix Windows test failures and real Windows bugs, skip Lin…
Windows CI: fix Windows test failures and real Windows bugs, skip Lin…
Windows CI: fix Windows test failures and real Windows bugs, skip Lin…
Windows CI: fix Windows test failures and real Windows bugs, skip Lin…
CI: run the unit tests on Windows (#971) (#973)
scttfrdmn commentedon Oct 19, 2026
Fixed in be7112d (#973, "Fixes #999").
pkg/aws/snapshot_image.go:90-93on main: the raw-image path's Cleanup now closes the reader (Cleanup: func() { _ = rc.Close() }); CHANGELOG entry under (#999).