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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Handle panic in mirror.syncMirror
Signed-off-by: Andrew Thornton <[email protected]>
  • Loading branch information
zeripath committed May 4, 2020
commit 495183cc350bdd79fc5f8e7f674c862010b82cc6
8 changes: 8 additions & 0 deletions services/mirror/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,14 @@ func SyncMirrors(ctx context.Context) {

func syncMirror(repoID string) {
log.Trace("SyncMirrors [repo_id: %v]", repoID)
defer func() {
err := recover()
if err == nil {
return
}
// There was a panic whilst syncMirrors...
log.Error("PANIC whilst syncMirrors[%s] Panic: %v\nStacktrace: %s", repoID, err, log.Stack(2))
}()
mirrorQueue.Remove(repoID)

m, err := models.GetMirrorByRepoID(com.StrTo(repoID).MustInt64())
Expand Down