Merge pull request #5308 from heyitsanthony/fix-init-notify

etcdmain: notify systemd when etcd is ready to accept requests
This commit is contained in:
Anthony Romano 2016-05-10 13:55:06 -07:00
commit 6b2d7f9412

View File

@ -178,10 +178,9 @@ func Main() {
if systemdutil.IsRunningSystemd() {
// At this point, the initialization of etcd is done.
// The listeners are listening on the TCP ports and ready
// for accepting connections.
// The http server is probably ready for serving incoming
// connections. If it is not, the connection might be pending
// for less than one second.
// for accepting connections. The etcd instance should be
// joined with the cluster and ready to serve incoming
// connections.
err := daemon.SdNotify("READY=1")
if err != nil {
plog.Errorf("failed to notify systemd for readiness: %v", err)
@ -397,6 +396,7 @@ func startEtcd(cfg *config) (<-chan struct{}, error) {
}(sctx)
}
<-s.ReadyNotify()
return s.StopNotify(), nil
}