diff options
author | zeripath <art27@cantab.net> | 2021-10-15 19:41:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-15 19:41:34 +0100 |
commit | 58cd55d3535e5afe551610cb74588b33d97786a2 (patch) | |
tree | 6d1b5aa36eccc5ec23bb0a1500dc90e086b917bb /modules | |
parent | a889d0cc8c70431d43a9e46a6cf859f7b490aeb3 (diff) | |
download | gitea-58cd55d3535e5afe551610cb74588b33d97786a2.tar.gz gitea-58cd55d3535e5afe551610cb74588b33d97786a2.zip |
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>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/git/log_name_status.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/git/log_name_status.go b/modules/git/log_name_status.go index e792b02a5d..8f816950de 100644 --- a/modules/git/log_name_status.go +++ b/modules/git/log_name_status.go @@ -350,6 +350,9 @@ heaploop: } current, err := g.Next(treepath, path2idx, changed, maxpathlen) if err != nil { + if err == context.DeadlineExceeded { + break heaploop + } g.Close() return nil, err } |