diff --git a/README.org b/README.org index 5d21f54..d9cc3d5 100644 --- a/README.org +++ b/README.org @@ -611,6 +611,12 @@ munet> description "Shell command[s] to execute to determine if the node is ready"; } + leaf ready-timeout { + type uint32; + default 30; + description + "Maximum time in seconds to wait for the node to become ready."; + } leaf image { type string; must "not(../hostnet) and not(../qemu) and not(../server)" { diff --git a/munet/munet-schema.json b/munet/munet-schema.json index b61ce5c..ca3a004 100644 --- a/munet/munet-schema.json +++ b/munet/munet-schema.json @@ -105,6 +105,9 @@ "ready-cmd": { "type": "string" }, + "ready-timeout": { + "type": "integer" + }, "image": { "type": "string" }, @@ -593,6 +596,9 @@ "ready-cmd": { "type": "string" }, + "ready-timeout": { + "type": "integer" + }, "image": { "type": "string" }, diff --git a/munet/native.py b/munet/native.py index bf1bfae..acc5d0e 100644 --- a/munet/native.py +++ b/munet/native.py @@ -3586,7 +3586,18 @@ async def wait_until_ready(x): tasks = [asyncio.create_task(wait_until_ready(x)) for x in ready_nodes] logging.debug("Waiting for ready on nodes: %s", ready_nodes) - _, pending = await asyncio.wait(tasks, timeout=30) + + # setable via "ready-timeout: 600" in kinds.yaml. + ready_timeout = max( + node.config.get("ready-timeout", 30) for node in ready_nodes + ) + self.logger.info( + "waiting up to %ss for ready-cmd on %s ready nodes", + ready_timeout, + len(ready_nodes), + ) + + _, pending = await asyncio.wait(tasks, timeout=ready_timeout) if pending: logging.warning("Timeout waiting for ready: %s", pending) for nr in pending: