oxidecomputer / oxidecomputer/omicron-package

failure to append an input to a package tarball leaves an incomplete tarball in the output location

Open
#68 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3
Forks
5
PR merge metrics
No merged PRs in 30d

Description

See https://github.com/oxidecomputer/propolis/issues/812 for a specific case of this.

ILTM like the output archive gets created on this path, at least for zone tarballs: https://github.com/oxidecomputer/omicron-package/blob/13afd8cc7588abb4adcf584f7983c1b93ae70f9d/src/package.rs#L664-L674

If one of the calls to add_input_to_package fails, the ArchiveBuilder and its enclosed tar::Builder will be dropped. Dropping the tar::Builder finalizes the archive (by calling Builder::finish) in whatever state it was in when the error occurred.

It would be nice either to delete partial package archives on failure or (as @faithanalog suggested in propolis#812) construct them in a temporary location and move them to the final location only when the archive is fully constructed.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/package.rs at the package-archive creation path around lines 664-674 and trace calls to add_input_to_package. Compare the two proposed failure-handling approaches, then verify that an error during archive construction does not leave an incomplete package tarball at the final output location.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.