Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -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)" {
Expand Down
6 changes: 6 additions & 0 deletions munet/munet-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@
"ready-cmd": {
"type": "string"
},
"ready-timeout": {
"type": "integer"
},
"image": {
"type": "string"
},
Expand Down Expand Up @@ -593,6 +596,9 @@
"ready-cmd": {
"type": "string"
},
"ready-timeout": {
"type": "integer"
},
"image": {
"type": "string"
},
Expand Down
13 changes: 12 additions & 1 deletion munet/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading