git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] commit-graph: when closing the graph, also release the slab

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 8, 2021, 08:29 UTC
Message-ID
<aade3ca574063a73d849a0081e4653a7f30eda78.1631089771.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1032.git.1631089771.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 commit-graph.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/commit-graph.c b/commit-graph.c
index 3860a0d8477..09984455150 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -713,6 +713,7 @@ static void close_commit_graph_one(struct commit_graph *g)
 	if (!g)
 		return;
 
+	clear_commit_graph_data_slab(&commit_graph_data_slab);
 	close_commit_graph_one(g->base_graph);
 	free_commit_graph(g);
 }
-- 
gitgitgadget
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin via GitGitGadget
Message 2 of 5 in “pull: release handles to pack files before potentially gc'ing”
  1. 0/2 pull: release handles to pack files before potentially gc'ingJohannes Schindelin via GitGitGadget, Sep 8, 2021
  2. 1/2 commit-graph: when closing the graph, also release the slabJohannes Schindelin via GitGitGadget, Sep 8, 2021
  3. 2/2 pull: release packs before fetchingJohannes Schindelin via GitGitGadget, Sep 8, 2021
  4. Junio C HamanoSep 8, 2021
  5. Johannes SchindelinSep 9, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.