Skip to content

[Do-not-merge] Test the updated tar-split with podman.#28018

Draft
jankaluza wants to merge 1 commit intocontainers:mainfrom
jankaluza:tar-split
Draft

[Do-not-merge] Test the updated tar-split with podman.#28018
jankaluza wants to merge 1 commit intocontainers:mainfrom
jankaluza:tar-split

Conversation

@jankaluza
Copy link
Copy Markdown
Member

Checklist

Ensure you have completed the following checklist for your pull request to be reviewed:

  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all
    commits. (git commit -s). (If needed, use git commit -s --amend). The author email must match
    the sign-off email address. See CONTRIBUTING.md
    for more information.
  • Referenced issues using Fixes: #00000 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below (or None if no user-facing changes)

Does this PR introduce a user-facing change?


Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
@Luap99
Copy link
Copy Markdown
Member

Luap99 commented Feb 3, 2026

The proper way to test things is using a go.mod replace
https://github.com/containers/container-libs/blob/main/CONTRIBUTING_GO.md#testing-changes-in-a-dependent-repository

@Luap99 Luap99 marked this pull request as draft February 3, 2026 14:21
Copy link
Copy Markdown
Contributor

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

Some comments as part of looking at vbatts/tar-split#86 .

This is quite a bit of ceremony, and there is one other caller in the project.

So I suppose we’d want an internal/ utility to deal with all this… and would we then consider changing the API in tar-split instead, to make such a utility unnecessary?

uncompressed, err := archive.DecompressStream(defragmented)
if err != nil {
return -1, 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.

It’s not obvious to me why the creation of uncompressed was moved. Is there a reason to do that? (“Aesthetics” could be a valid reason, I just want to know I’m not missing anything.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Trying to remember and I believe the reason was that this reduced one more place where I would have to call uncrompressed.Close() in case of error. If it would stay in its original place, I would have to call it also in the error handling block of NewLogger.

But reading your comment above about defer uncompressed.Close(), it could even stay where it is is that defer is done.

return applyDriverFunc(payload)
// cleanup closes tsRdr, waits for tar-split to finish, then closes uncompressed.
// It returns the tar-split goroutine's error (if any).
var once sync.Once
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.

(A cleanupDone bool would work, this does not need to handle concurrency.)

}
defer idLogger.Close() // This must happen before uidLog and gidLog is consumed.

uncompressed, err := archive.DecompressStream(defragmented)
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.

I’m a little unhappy about removing the defer uncompressed.Close() here.

AFAIK defers are processed in LIFO order, so that should still be fine. We rely on that for metadata vs. compressor already.


size, applyErr := applyDriverFunc(tsRdr)

// Normal path: cleanup exactly once.
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.

Critically, we must wait until writes to metadata and reads from uncompressed are truly done. I think that’s worth documenting.

@jankaluza
Copy link
Copy Markdown
Member Author

@mtrmac , thanks for your feedback even here. I will see how vbatts/tar-split#86 ends up before updating this one, since there is no real blocker which would prove vbatts/tar-split#86 useless.

@github-actions
Copy link
Copy Markdown

A friendly reminder that this PR had no activity for 30 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants