Skip to content

avoid per-entry xattr path wrapper during unpack - #114

Merged
thaJeztah merged 1 commit into
moby:mainfrom
crazy-max:lazy-xattr-path-resolution
Aug 14, 2026
Merged

avoid per-entry xattr path wrapper during unpack#114
thaJeztah merged 1 commit into
moby:mainfrom
crazy-max:lazy-xattr-path-resolution

Conversation

@crazy-max

@crazy-max crazy-max commented Aug 14, 2026

Copy link
Copy Markdown
Member

createTarFile used sync.OnceValues to delay resolving the bounded filesystem path until an xattr PAX record was found, but that still created the lazy wrapper for every extracted entry.

Track the resolved path with simple local state inside the xattr loop instead, so entries without SCHILY.xattr records avoid that setup while entries with xattrs still resolve the path only once.

@codecov-commenter

codecov-commenter commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.64%. Comparing base (e738eed) to head (66cf06f).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
archive.go 75.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #114      +/-   ##
==========================================
+ Coverage   65.25%   65.64%   +0.39%     
==========================================
  Files          46       46              
  Lines        2377     2393      +16     
==========================================
+ Hits         1551     1571      +20     
+ Misses        606      602       -4     
  Partials      220      220              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@crazy-max
crazy-max requested review from thaJeztah and vvoland August 14, 2026 14:27
@crazy-max
crazy-max marked this pull request as ready for review August 14, 2026 14:27
createTarFile used sync.OnceValues to delay resolving the bounded filesystem path
until an xattr PAX record was found, but that still created the lazy wrapper for
every extracted entry.

Track the resolved path with simple local state inside the xattr loop instead, so
entries without SCHILY.xattr records avoid that setup while entries with xattrs still
resolve the path only once.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max
crazy-max force-pushed the lazy-xattr-path-resolution branch from fadc76f to 66cf06f Compare August 14, 2026 14:38
@crazy-max crazy-max changed the title resolve xattr paths lazily during unpack avoid per-entry xattr path wrapper during unpack Aug 14, 2026
@thaJeztah

Copy link
Copy Markdown
Member

Ah, yeah, I probably should've removed it in 51d1dd0 - before that there were multiple paths calling absPath() so it made more sense

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
thaJeztah merged commit fe3726a into moby:main Aug 14, 2026
12 checks passed
@crazy-max
crazy-max deleted the lazy-xattr-path-resolution branch August 14, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants