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 locking issues with git fetch --multiple --jobs=<n> and fetch.writeCommitGraph #443

Closed

Conversation

dscho
Copy link
Member

@dscho dscho commented Nov 3, 2019

The git fetch command recently learned to extend the --jobs=<n> option to cover the --multiple mode: it will run multiple fetches in parallel.

Together with the recent support to write commit-graphs automatically after each fetch by setting fetch.writeCommitGraph, this led to frequent issues where the commit-graph-chain.lock file could not be created because a parallel job had already created it.

This pair of patches first introduces the command-line option --write-commit-graph (together with the --no-* variant) and then uses it to avoid writing the commit-graph until all fetch jobs are complete.

I don't think that we will want to rush this into Git v2.24.0 because that release is imminent, and this is quite a corner case that I am fixing here. It's more of a FYI that I send this before v2.24.0 is available.

Cc: Derrick Stolee dstolee@microsoft.com

This option overrides the config setting `fetch.writeCommitGraph`, if
both are set.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When both `fetch.jobs` and `fetch.writeCommitGraph` is set, we currently
try to write the commit graph in each of the concurrent fetch jobs,
which frequently leads to error messages like this one:

fatal: Unable to create '.../.git/objects/info/commit-graphs/commit-graph-chain.lock': File exists.

Let's avoid this by holding off from writing the commit graph until all
fetch jobs are done.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho changed the title Fix locking issues in commit-graph writing during parallel fetch jobs Fix locking issues with git fetch --multiple --jobs=<n> and fetch.writeCommitGraph Nov 3, 2019
@dscho
Copy link
Member Author

dscho commented Nov 3, 2019

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 3, 2019

@gitgitgadget

This comment has been minimized.

@gitgitgadget

This comment has been minimized.

@gitgitgadget

This comment has been minimized.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 6, 2019

This branch is now known as js/fetch-multi-lockfix.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 6, 2019

This patch series was integrated into pu via git@37ff0f3.

@gitgitgadget gitgitgadget bot added the pu label Nov 6, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented Nov 7, 2019

This patch series was integrated into pu via git@bbf700d.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 8, 2019

This patch series was integrated into pu via git@2ff8134.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 10, 2019

This patch series was integrated into pu via git@0c6f8fb.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 11, 2019

This patch series was integrated into pu via git@7fa890e.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 12, 2019

This patch series was integrated into pu via git@f322f4e.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 19, 2019

This patch series was integrated into pu via git@24a526b.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 19, 2019

This patch series was integrated into next via git@b9683b7.

@gitgitgadget gitgitgadget bot added the next label Nov 19, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented Nov 20, 2019

This patch series was integrated into pu via git@d02d16f.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 21, 2019

This patch series was integrated into pu via git@193c837.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 22, 2019

This patch series was integrated into pu via git@4f9c4c4.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 25, 2019

This patch series was integrated into pu via git@acb44ee.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 27, 2019

This patch series was integrated into pu via git@9da0221.

@gitgitgadget
Copy link

gitgitgadget bot commented Dec 2, 2019

This patch series was integrated into pu via git@bcb06e2.

@gitgitgadget
Copy link

gitgitgadget bot commented Dec 2, 2019

This patch series was integrated into next via git@bcb06e2.

@gitgitgadget
Copy link

gitgitgadget bot commented Dec 2, 2019

This patch series was integrated into master via git@bcb06e2.

@gitgitgadget gitgitgadget bot added the master label Dec 2, 2019
@gitgitgadget gitgitgadget bot closed this Dec 2, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented Dec 2, 2019

Closed via bcb06e2.

@dscho dscho deleted the fetch.writeCommitGraph-and-fetch-jobs branch December 2, 2019 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant