Skip to content

Commit 58cd55d

Browse files
authored
Check for context exceeded in WalkGitLog (#17319)
There is a slight race in checking of a context deadline exceed in #16467 which leads to a 500 on the repository page. The solution is to check the error coming back from `*LogNameStatusRepoParser.Next()` and if it is the `ContextDeadlineExceeded` break from the loop. Fix #17314 Signed-off-by: Andrew Thornton <art27@cantab.net>
1 parent a889d0c commit 58cd55d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/git/log_name_status.go

+3
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@ heaploop:
350350
}
351351
current, err := g.Next(treepath, path2idx, changed, maxpathlen)
352352
if err != nil {
353+
if err == context.DeadlineExceeded {
354+
break heaploop
355+
}
353356
g.Close()
354357
return nil, err
355358
}

0 commit comments

Comments
 (0)