File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,15 @@ func (g *Manager) start(ctx context.Context) {
118118 defer close (startupDone )
119119 // Wait till we're done getting all of the listeners and then close
120120 // the unused ones
121- g .createServerWaitGroup .Wait ()
121+ func () {
122+ // FIXME: there is a fundamental design problem of the "manager" and the "wait group".
123+ // If nothing has started, the "Wait" just panics: sync: WaitGroup is reused before previous Wait has returned
124+ // There is no clear solution besides a complete rewriting of the "manager"
125+ defer func () {
126+ _ = recover ()
127+ }()
128+ g .createServerWaitGroup .Wait ()
129+ }()
122130 // Ignore the error here there's not much we can do with it
123131 // They're logged in the CloseProvidedListeners function
124132 _ = CloseProvidedListeners ()
Original file line number Diff line number Diff line change @@ -227,7 +227,15 @@ func (g *Manager) awaitServer(limit time.Duration) bool {
227227 c := make (chan struct {})
228228 go func () {
229229 defer close (c )
230- g .createServerWaitGroup .Wait ()
230+ func () {
231+ // FIXME: there is a fundamental design problem of the "manager" and the "wait group".
232+ // If nothing has started, the "Wait" just panics: sync: WaitGroup is reused before previous Wait has returned
233+ // There is no clear solution besides a complete rewriting of the "manager"
234+ defer func () {
235+ _ = recover ()
236+ }()
237+ g .createServerWaitGroup .Wait ()
238+ }()
231239 }()
232240 if limit > 0 {
233241 select {
You can’t perform that action at this time.
0 commit comments