Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "failed to create hardlink" error due to multiple mounts on the same device (Cherry-pick of #19894) #19914

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

stuhood
Copy link
Member

@stuhood stuhood commented Sep 22, 2023

As described in #18757, the "check that source and dest are on same device" strategy that was introduced in #18153 to decide whether we could hardlink when materializing files was not robust when faced with the same device being mounted in multiple locations.

This change moves to a "create a canary" strategy for deciding when hardlinking between two destinations is legal. Hardlinks are canaried and memoized on a per-destination-root basis, so this strategy might actually be slightly cheaper than the previous one.

Fixes #18757.

…ame device (pantsbuild#19894)

As described in pantsbuild#18757, the "check that source and dest are on same
device" strategy that was introduced in pantsbuild#18153 to decide whether we
could hardlink when materializing files was not robust when faced with
the same device being mounted in multiple locations.

This change moves to a "create a canary" strategy for deciding when
hardlinking between two destinations is legal. Hardlinks are canaried
and memoized on a per-destination-root basis, so this strategy might
actually be slightly cheaper than the previous one.

Fixes pantsbuild#18757.
@stuhood stuhood added this to the 2.17.x milestone Sep 22, 2023
@stuhood stuhood added the category:bugfix Bug fixes for released features label Sep 22, 2023
@stuhood stuhood requested review from thejcannon and huonw September 22, 2023 14:29
@stuhood stuhood merged commit e957eb5 into pantsbuild:2.17.x Sep 22, 2023
@stuhood stuhood deleted the cherry-pick-19894-to-2.17.x branch September 22, 2023 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants