Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions subcommands/pkg/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ func (cmd *PkgCreate) Execute(ctx *appcontext.AppContext, _ *repository.Reposito
return 1, fmt.Errorf("failed to commit snapshot: %w", err)
}

if err := snap.Close(); err != nil {
return 1, fmt.Errorf("failed to close snapshot: %w", err)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This closes the scanCache, which is then used in CommitTransaction AFAIK to publish the delta state to teh repository. Am I missing something obvious?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i forgot some context in this, sorry.

this diff was before i discovered the issue on windows, when i was still searching for possible causes.

I was comparing pkg/create.go with subcommands/ptar and noticed the missing close, but it wasn't the fix obviously :)

in subcommands/ptar we do close the snap, look: https://github.com/PlakarKorp/plakar/blob/main/subcommands/ptar/ptar.go#L378-L381

// We are done with everything we can now stop the backup routines.
repoWriter.PackerManager.Wait()
err = repoWriter.CommitTransaction(identifier)
Expand Down
Loading