From bdca149e41dd77d6a3f10d5b68a61d79aeb527d8 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 23 Apr 2020 11:18:59 +0200 Subject: [PATCH 1/3] cleanup commit-graph-chain.lock file after crash --- internal/service/repository/cleanup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/repository/cleanup.go b/internal/service/repository/cleanup.go index ec8518516e..54469938a1 100644 --- a/internal/service/repository/cleanup.go +++ b/internal/service/repository/cleanup.go @@ -15,7 +15,7 @@ import ( "google.golang.org/grpc/status" ) -var lockFiles = []string{"config.lock", "HEAD.lock"} +var lockFiles = []string{"config.lock", "HEAD.lock", "objects/info/commit-graphs/commit-graph-chain.lock"} func (*server) Cleanup(ctx context.Context, in *gitalypb.CleanupRequest) (*gitalypb.CleanupResponse, error) { if err := cleanupRepo(ctx, in.GetRepository()); err != nil { -- GitLab From 1738c143067d38d21a49b1648992cf2494622c0a Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 23 Apr 2020 11:40:15 +0200 Subject: [PATCH 2/3] fix test case --- internal/service/repository/gc_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/repository/gc_test.go b/internal/service/repository/gc_test.go index c3823bc386..1295e32757 100644 --- a/internal/service/repository/gc_test.go +++ b/internal/service/repository/gc_test.go @@ -323,6 +323,7 @@ func TestCleanupInvalidKeepAroundRefs(t *testing.T) { } func createFileWithTimes(path string, mTime time.Time) { + os.MkdirAll(filepath.Dir(path), 0755) ioutil.WriteFile(path, nil, 0644) os.Chtimes(path, mTime, mTime) } -- GitLab From 30d040b9c899c816698daeaf1864d3c9dd03bf01 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 23 Apr 2020 11:53:40 +0200 Subject: [PATCH 3/3] add changelog --- changelogs/unreleased/cleanup-commit-graph-chain-lock.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/unreleased/cleanup-commit-graph-chain-lock.yml diff --git a/changelogs/unreleased/cleanup-commit-graph-chain-lock.yml b/changelogs/unreleased/cleanup-commit-graph-chain-lock.yml new file mode 100644 index 0000000000..4985044d6b --- /dev/null +++ b/changelogs/unreleased/cleanup-commit-graph-chain-lock.yml @@ -0,0 +1,5 @@ +--- +title: cleanup commit-graph-chain.lock file after crash +merge_request: 2099 +author: +type: fixed -- GitLab