Skip to content
Open
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
19 changes: 18 additions & 1 deletion munet/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment below. Add this new config node and the description of its behavior to the munet YANG module.


for node in ready_nodes:

@liambrady liambrady Jul 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like there is probably a more idiomatic python solution for this block. Maybe something like ready_timeout = max ([node.config.get("ready-timeout", 30) for node in ready_nodes])?

There should be no need to try/except the string->integer conversion, since the config is checked against the expected config schema. (Error messages are generated if the leaf is of the wrong type, doesn't exist in the schema, etc.) So long as it is defined as an integer in the schema, we should be able to assume it is an integer in the code.

In order to add new config to the schema, update the YANG module within munet/README.org and then run make check. You should see that munet/munet-schema.json inherits the updates.

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:
Expand Down
Loading