mirror of https://github.com/status-im/consul.git
Fixes a startup ordering issue between Raft and Serf.
This fixes #2663 and fixes #1899. It's not super related to this PR, but the startup time changes that this PR brings made this a lot worse so I was able to track it down.
This commit is contained in:
parent
6ca0173907
commit
32be684fdf
|
@ -284,6 +284,10 @@ func NewServer(config *Config) (*Server, error) {
|
||||||
}
|
}
|
||||||
go s.wanEventHandler()
|
go s.wanEventHandler()
|
||||||
|
|
||||||
|
// Start monitoring leadership. This must happen after Serf is set up
|
||||||
|
// since it can fire events when leadership is obtained.
|
||||||
|
go s.monitorLeadership()
|
||||||
|
|
||||||
// Start ACL replication.
|
// Start ACL replication.
|
||||||
if s.IsACLReplicationEnabled() {
|
if s.IsACLReplicationEnabled() {
|
||||||
go s.runACLReplication()
|
go s.runACLReplication()
|
||||||
|
@ -491,9 +495,6 @@ func (s *Server) setupRaft() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start monitoring leadership.
|
|
||||||
go s.monitorLeadership()
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue