You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once #6371 is merged, FRR will have built-in support for asynchronous YANG-modeled operational data retrieval. As of now, however, the CLI can't take advantage of this new capability since all CLI commands are synchronous, they block the main pthread until they are finished.
It should be possible, however, to have asynchronous commands by doing some small changes in the CLI code. One possibility would be to add a new CLI return value (e.g. CMD_SUSPEND) which would instruct the CLI to stop reading from stdin. Then, at any given point, a new API function like vty_resume(vty) could be used to instruct the CLI to resume reading from stdin.
These small additions would allow us, for example, to write commands that fetch bulk data (e.g. millions of routes) in small chunks, without blocking the main pthread of the relevant daemons.
A slightly more advanced implementation would also keep track of the event (or thread) the async command is waiting on, and run a timeout timer to abort the command in case it's taking too long to complete. That would prevent the CLI from becoming unresponsive because of a badly behaved command.
I'm opening this issue mostly for tracking purposes and also to discuss alternate implementation ideas.
This discussion was converted from issue #6372 on July 24, 2023 22:33.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Once #6371 is merged, FRR will have built-in support for asynchronous YANG-modeled operational data retrieval. As of now, however, the CLI can't take advantage of this new capability since all CLI commands are synchronous, they block the main pthread until they are finished.
It should be possible, however, to have asynchronous commands by doing some small changes in the CLI code. One possibility would be to add a new CLI return value (e.g.
CMD_SUSPEND
) which would instruct the CLI to stop reading from stdin. Then, at any given point, a new API function likevty_resume(vty)
could be used to instruct the CLI to resume reading from stdin.These small additions would allow us, for example, to write commands that fetch bulk data (e.g. millions of routes) in small chunks, without blocking the main pthread of the relevant daemons.
A slightly more advanced implementation would also keep track of the event (or
thread
) the async command is waiting on, and run a timeout timer to abort the command in case it's taking too long to complete. That would prevent the CLI from becoming unresponsive because of a badly behaved command.I'm opening this issue mostly for tracking purposes and also to discuss alternate implementation ideas.
Beta Was this translation helpful? Give feedback.
All reactions