Skip to content

Conversation

@6543
Copy link
Member

@6543 6543 commented Jul 13, 2022

Backport #20346

Although WalkGitLog tries to test for context.DeadlineExceededErr
there is a small chance that the error will propagate to the reader
before it is recognised. This will cause the error to propagate up to
renderDirectoryFiles and cause a http status 500.

Here we check that the error passed is a DeadlineExceededErr via errors.Is

Fix #20329

Signed-off-by: Andrew Thornton [email protected]

…a#20346)

* Prevent context deadline error propagation in GetCommitsInfo

Although `WalkGitLog` tries to test for `context.DeadlineExceededErr`
there is a small chance that the error will propagate to the reader
before it is recognised. This will cause the error to propagate up to
`renderDirectoryFiles` and cause a http status 500.

Here we check that the error passed is a `DeadlineExceededErr` via error.Is

Fix go-gitea#20329

Signed-off-by: Andrew Thornton <[email protected]>
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jul 14, 2022
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 14, 2022
@zeripath zeripath merged commit 780b198 into go-gitea:release/v1.17 Jul 14, 2022
@zeripath zeripath deleted the backport_20346 branch July 14, 2022 02:44
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants