Restore NotifyListen to avoid panic in newServer retry (#6200)

This commit is contained in:
Freddy 2019-07-23 14:33:00 -06:00 committed by GitHub
parent 12d263e6b0
commit c19f46639b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -183,6 +183,10 @@ func newServer(c *Config) (*Server, error) {
oldNotify()
}
}
// Restore old notify to guard against re-closing `up` on a retry
defer func() {
c.NotifyListen = oldNotify
}()
// start server
w := c.LogOutput