-
Notifications
You must be signed in to change notification settings - Fork 11
native: configurable ready timeout #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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 |
||
| 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: | ||
|
|
||
There was a problem hiding this comment.
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.