gitserver: Handle and ignore filepath.Walk error
Created by: keegancsmith
filepath.Walk can return errors if we run into permission errors or a file
disappears between readdir
and the stat
of the file. In either case this
error isn't important for our cleanup, so we just ignore it. This is what we
typically do in the rest of the gitserver uses of filepath.Walk
Previously we ignored the error completely, which would lead to info
being
nil => panic. This bug has existed for a long time, but is a hard to trip
panic.
Fixes https://github.com/sourcegraph/sourcegraph/issues/6710
Merge request reports
Activity
Created by: codecov[bot]
Codecov Report
Merging #7030 into master will increase coverage by
<.01%
. The diff coverage is0%
.@@ Coverage Diff @@ ## master #7030 +/- ## ========================================== + Coverage 39.23% 39.23% +<.01% ========================================== Files 1230 1230 Lines 63533 63535 +2 Branches 6041 6041 ========================================== + Hits 24924 24926 +2 Misses 36326 36326 Partials 2283 2283
Impacted Files Coverage Δ cmd/gitserver/server/cleanup.go 64.18% <0%> (-0.37%)
cmd/frontend/graphqlbackend/repository.go 21.65% <0%> (+0.92%)
Created by: keegancsmith
Might be worth adding a bit more context to the comment.
I'll follow-up with a clearer API to be used across gitserver.