parent
0759df74e0
commit
8210523b1b
|
@ -131,10 +131,7 @@ func NewClientLogger(config *Config, logger *log.Logger) (*Client, error) {
|
||||||
shutdownCh: make(chan struct{}),
|
shutdownCh: make(chan struct{}),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start lan event handlers before lan Serf setup to prevent deadlock
|
// Initialize the LAN Serf
|
||||||
go c.lanEventHandler()
|
|
||||||
|
|
||||||
// Initialize the lan Serf
|
|
||||||
c.serf, err = c.setupSerf(config.SerfLANConfig,
|
c.serf, err = c.setupSerf(config.SerfLANConfig,
|
||||||
c.eventCh, serfLANSnapshot)
|
c.eventCh, serfLANSnapshot)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -146,6 +143,10 @@ func NewClientLogger(config *Config, logger *log.Logger) (*Client, error) {
|
||||||
c.routers = router.New(c.logger, c.shutdownCh, c.serf, c.connPool)
|
c.routers = router.New(c.logger, c.shutdownCh, c.serf, c.connPool)
|
||||||
go c.routers.Start()
|
go c.routers.Start()
|
||||||
|
|
||||||
|
// Start LAN event handlers after the router is complete since the event
|
||||||
|
// handlers depend on the router and the router depends on Serf.
|
||||||
|
go c.lanEventHandler()
|
||||||
|
|
||||||
return c, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue