Skip to content

native: configurable ready timeout#99

Open
john-a-joyce wants to merge 1 commit into
LabNConsulting:mainfrom
john-a-joyce:ready-timeout
Open

native: configurable ready timeout#99
john-a-joyce wants to merge 1 commit into
LabNConsulting:mainfrom
john-a-joyce:ready-timeout

Conversation

@john-a-joyce

Copy link
Copy Markdown

Allow the node ready timeout to be configurable.

Allow the node ready timeout to be configurable.

@liambrady liambrady left a comment

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.

please run make ci-lint and fix all linting errors (for the CI to run)

Comment thread munet/native.py
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:

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-timer", 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.

Comment thread munet/native.py
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants