Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Carlbäcker <kim.carlbacker@gmail.com>2018-05-29 01:17:53 +0300
committerKim Carlbäcker <kim.carlbacker@gmail.com>2018-05-29 01:17:53 +0300
commit273532e2e48cff5aa702463345e17211a2ea0f40 (patch)
tree45fe50a8c7d8178feba114e1f222abbfa9e204ab
parent307f8ab481eeae2ab2a3d69f9aeadbfabc1140d9 (diff)
parent2c737278a6cfc23a6b74defc8647788a9182cf35 (diff)
Merge branch 'cleanup-ignore-eexist' into 'master'
Ignore ENOENT when cleaning up lock files See merge request gitlab-org/gitaly!740
-rw-r--r--changelogs/unreleased/cleanup-ignore-eexist.yml5
-rw-r--r--internal/service/repository/cleanup.go5
2 files changed, 10 insertions, 0 deletions
diff --git a/changelogs/unreleased/cleanup-ignore-eexist.yml b/changelogs/unreleased/cleanup-ignore-eexist.yml
new file mode 100644
index 000000000..a17cabc50
--- /dev/null
+++ b/changelogs/unreleased/cleanup-ignore-eexist.yml
@@ -0,0 +1,5 @@
+---
+title: Ignore ENOENT when cleaning up lock files
+merge_request: 740
+author:
+type: fixed
diff --git a/internal/service/repository/cleanup.go b/internal/service/repository/cleanup.go
index c3e99daf2..f54a3dfb1 100644
--- a/internal/service/repository/cleanup.go
+++ b/internal/service/repository/cleanup.go
@@ -47,6 +47,11 @@ func cleanupRepo(repoPath string) error {
func cleanRefsLocks(rootPath string, threshold time.Time) error {
return filepath.Walk(rootPath, func(path string, info os.FileInfo, err error) error {
+ if os.IsNotExist(err) {
+ // Race condition: somebody already deleted the file for us. Ignore this file.
+ return nil
+ }
+
if err != nil {
return err
}