Skip to content

Commit 5952d34

Browse files
committed
Check for context exceeded in WalkGitLog
There is a slight race in checking of a context deadline exceed in go-gitea#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 go-gitea#17314 Signed-off-by: Andrew Thornton <[email protected]>
1 parent a889d0c commit 5952d34

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/git/log_name_status.go

Lines changed: 3 additions & 0 deletions
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)