all: Don't let Suture capture panics (fixes #4758) (#5119)

Fork with new option.
This commit is contained in:
Jakob Borg
2018-08-13 20:39:08 +02:00
committed by GitHub
parent c55c0c8c28
commit 48795dba07
18 changed files with 63 additions and 37 deletions

View File

@@ -10,10 +10,10 @@ import (
stdsync "sync"
"time"
"github.com/calmh/suture"
"github.com/syncthing/syncthing/lib/protocol"
"github.com/syncthing/syncthing/lib/sync"
"github.com/syncthing/syncthing/lib/util"
"github.com/thejerf/suture"
)
// The CachingMux aggregates results from multiple Finders. Each Finder has
@@ -51,8 +51,10 @@ type cachedError interface {
func NewCachingMux() CachingMux {
return &cachingMux{
Supervisor: suture.NewSimple("discover.cachingMux"),
mut: sync.NewRWMutex(),
Supervisor: suture.New("discover.cachingMux", suture.Spec{
PanicPanics: true,
}),
mut: sync.NewRWMutex(),
}
}