Skip to content

Commit

Permalink
domain: avoid panic in the init stats breaking the loadStatsWorker (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei authored and ti-chi-bot committed Mar 14, 2024
1 parent eb9a5c7 commit 51cb32f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2226,6 +2226,10 @@ func (do *Domain) newOwnerManager(prompt, ownerKey string) owner.Manager {
func (do *Domain) initStats() {
statsHandle := do.StatsHandle()
defer func() {
if r := recover(); r != nil {
logutil.BgLogger().Error("panic when initiating stats", zap.Any("r", r),
zap.Stack("stack"))
}
close(statsHandle.InitStatsDone)
}()
t := time.Now()
Expand Down

0 comments on commit 51cb32f

Please sign in to comment.