git pull: release file handles to pack files before fetching#3415
Merged
dscho merged 2 commits intogit-for-windows:mainfrom Sep 8, 2021
Merged
git pull: release file handles to pack files before fetching#3415dscho merged 2 commits intogit-for-windows:mainfrom
dscho merged 2 commits intogit-for-windows:mainfrom
Conversation
bf8fab1 to
48566dd
Compare
dscho
commented
Sep 7, 2021
| if (!g) | ||
| return; | ||
|
|
||
| clear_commit_graph_data_slab(&commit_graph_data_slab); |
Member
Author
There was a problem hiding this comment.
@derrickstolee could I ask you to look over this change, to see whether it is sound?
There was a problem hiding this comment.
Makes sense. If we are closing the commit-graph, then the graph might change when we reopen it, leading to different graph_pos values.
derrickstolee
approved these changes
Sep 7, 2021
| if (!g) | ||
| return; | ||
|
|
||
| clear_commit_graph_data_slab(&commit_graph_data_slab); |
There was a problem hiding this comment.
Makes sense. If we are closing the commit-graph, then the graph might change when we reopen it, leading to different graph_pos values.
The slab has information about the commit graph. That means that it is meaningless (and even misleading) when the commit graph was closed. This seems not to matter currently, but we're about to fix a Windows-specific bug where `git pull` does not close the object store before fetching (risking that an implicit auto-gc fails to remove the now-obsolete pack file(s)), and once we have that bug fix in place, it does matter: after that bug fix, we will open the object store, do some stuff with it, then close it, fetch, and then open it again, and do more stuff. If we close the commit graph without releasing the corresponding slab, we're hit by a symptom like this in t5520.19: BUG: commit-reach.c:85: bad generation skip 9223372036854775807 > 3 at 5cd378271655d43a3b4477520014f02213ad1546 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
On Windows, files cannot be removed nor renamed if there are still handles held by a process. To remedy that, we try to release all open handles to any `.pack` file before e.g. repacking (which would want to remove the original `.pack` file(s) after it is done). Since the `read_cache_unmerged()` and/or the `get_oid()` call in `git pull` can cause `.pack` files to be opened, we need to release the open handles before calling `git fetch`: the latter process might want to spawn an auto-gc, which in turn might want to repack the objects. This commit is similar in spirit to 5bdece0 (gc/repack: release packs when needed, 2018-12-15). This fixes git-for-windows#3336. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
48566dd to
0e956ae
Compare
git-for-windows-ci
pushed a commit
that referenced
this pull request
Sep 8, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Sep 8, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Sep 8, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
to git-for-windows/build-extra
that referenced
this pull request
Sep 8, 2021
A bug where Git's garbage collection during a `git pull` failed to delete obsolete files [was fixed](git-for-windows/git#3415). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho
added a commit
that referenced
this pull request
Sep 8, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Sep 9, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Sep 9, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Sep 9, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Sep 10, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Sep 13, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Sep 13, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Sep 13, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Sep 13, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Sep 14, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Sep 15, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 4, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 4, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 4, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 6, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 7, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 13, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 13, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 13, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 13, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 13, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
to dscho/git
that referenced
this pull request
Oct 13, 2021
…re-fetching git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 13, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 13, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 14, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 14, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 14, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 14, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 14, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 14, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 14, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 14, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 14, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 14, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 15, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 15, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 15, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 15, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 15, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 15, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 15, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 18, 2021
git pull: release file handles to pack files before fetching
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 19, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 19, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 19, 2021
git pull: release file handles to pack files before fetching
dscho
added a commit
that referenced
this pull request
Oct 22, 2021
git pull: release file handles to pack files before fetching
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a tentative fix for #3336.