Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle panics that percolate up to the graceful module #11291

Merged
merged 6 commits into from
May 15, 2020

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented May 4, 2020

Log panics that percolate up to the graceful module with a stack trace and shut down the gitea instance as appropriately.

Also adds a panic handler to webhook.Deliver and mirror.syncMirrors.

Adds a some deferred functions to handle panics in graceful goroutines

Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
@zeripath zeripath added this to the 1.12.0 milestone May 4, 2020
@codecov-io
Copy link

codecov-io commented May 4, 2020

Codecov Report

Merging #11291 into master will increase coverage by 0.13%.
The diff coverage is 71.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11291      +/-   ##
==========================================
+ Coverage   43.84%   43.98%   +0.13%     
==========================================
  Files         613      614       +1     
  Lines       87229    87417     +188     
==========================================
+ Hits        38245    38448     +203     
+ Misses      44262    44235      -27     
- Partials     4722     4734      +12     
Impacted Files Coverage Δ
models/migrations/migrations.go 3.50% <ø> (ø)
models/migrations/v139.go 0.00% <0.00%> (ø)
models/oauth2.go 34.04% <ø> (ø)
modules/git/commit.go 49.84% <ø> (+0.45%) ⬆️
modules/git/repo_compare.go 73.52% <ø> (-0.39%) ⬇️
modules/webhook/slack.go 27.89% <0.00%> (+0.58%) ⬆️
routers/repo/milestone.go 0.00% <0.00%> (ø)
services/mirror/mirror.go 18.38% <0.00%> (-0.37%) ⬇️
modules/graceful/manager.go 28.07% <10.71%> (-3.18%) ⬇️
routers/repo/editor.go 24.59% <45.45%> (+0.25%) ⬆️
... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4159866...d8ee362. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 4, 2020
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 4, 2020
@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 May 14, 2020
@techknowlogick techknowlogick merged commit 4a04740 into go-gitea:master May 15, 2020
@zeripath zeripath deleted the handle-panics-in-goroutines branch May 15, 2020 06:25
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
* Handle panics in graceful goroutines

Adds a some deferred functions to handle panics in graceful goroutines

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

* Handle panic in webhook.Deliver

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

* Handle panic in mirror.syncMirror

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

Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
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.

None yet

6 participants