mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #5308 from heyitsanthony/fix-init-notify
etcdmain: notify systemd when etcd is ready to accept requests
This commit is contained in:
commit
6b2d7f9412
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user