Pause pvchealthd startup until node daemon is run
If the health daemon starts too soon during a node bootup, it will generate generate tons of erroneous faults while the node starts up. Adds a conditional wait for the current node daemon to be in "run" state before the health daemon really starts up.
This commit is contained in:
parent
f41c5176be
commit
709c9cb73e
|
@ -80,6 +80,11 @@ def entrypoint():
|
||||||
# Connect to Zookeeper and return our handler and current schema version
|
# Connect to Zookeeper and return our handler and current schema version
|
||||||
zkhandler, _ = pvchealthd.util.zookeeper.connect(logger, config)
|
zkhandler, _ = pvchealthd.util.zookeeper.connect(logger, config)
|
||||||
|
|
||||||
|
logger.out("Waiting for node daemon to be operating", state="s")
|
||||||
|
while zkhandler.read(("node.state.daemon", config["node_hostname"])) != "run":
|
||||||
|
sleep(5)
|
||||||
|
logger.out("Node daemon in run state, continuing health daemon startup", state="s")
|
||||||
|
|
||||||
# Define a cleanup function
|
# Define a cleanup function
|
||||||
def cleanup(failure=False):
|
def cleanup(failure=False):
|
||||||
nonlocal logger, zkhandler, monitoring_instance
|
nonlocal logger, zkhandler, monitoring_instance
|
||||||
|
|
Loading…
Reference in New Issue