From bba05a0c14c52b5f4c365e1c15a6afd48d6eeb37 Mon Sep 17 00:00:00 2001 From: John Joyce Date: Tue, 30 Jun 2026 13:51:51 -0400 Subject: [PATCH 1/2] native: configurable ready timeout Allow the node ready timeout to be configurable. --- munet/native.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/munet/native.py b/munet/native.py index bf1bfae..8e2edbe 100644 --- a/munet/native.py +++ b/munet/native.py @@ -3586,7 +3586,24 @@ 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) + ready_timeout = 30 + # setable via "ready-timeout: 600" in kinds.yaml if a particular type will take a long time. + + for node in ready_nodes: + try: + node_timeout = int(node.config.get("ready-timeout", ready_timeout)) + except (TypeError, ValueError): + node_timeout = ready_timeout + + ready_timeout = max(ready_timeout, node_timeout) + + 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: From 26a181f4ca4de9400f5da9b5158cbd10cd4961c2 Mon Sep 17 00:00:00 2001 From: John Joyce Date: Wed, 9 Sep 2026 16:38:00 -0400 Subject: [PATCH 2/2] Updates based on PR comments. --- README.org | 6 ++++++ munet/munet-schema.json | 6 ++++++ munet/native.py | 14 ++++---------- 3 files changed, 16 insertions(+), 10 deletions(-) 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 8e2edbe..acc5d0e 100644 --- a/munet/native.py +++ b/munet/native.py @@ -3586,17 +3586,11 @@ 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) - ready_timeout = 30 - # setable via "ready-timeout: 600" in kinds.yaml if a particular type will take a long time. - - for node in ready_nodes: - try: - node_timeout = int(node.config.get("ready-timeout", ready_timeout)) - except (TypeError, ValueError): - node_timeout = ready_timeout - - ready_timeout = max(ready_timeout, node_timeout) + # 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,