summaryrefslogtreecommitdiff
path: root/lib/command.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-10-05 21:20:28 -0300
committerRenato Westphal <renato@opensourcerouting.org>2019-10-11 21:18:36 -0300
commitc7c9103b01899d316372cc0272c37df9a7e59426 (patch)
treebb55ae803cd92985adc361711bbd24babdcb719c /lib/command.c
parentcaaa8b9c834dcf26292af67ebaaf154cac7cb8fe (diff)
lib: remove expensive error handling in the northbound CLI client
The nb_cli_apply_changes() function was creating a full copy of the candidate configuration before editing it. This excerpt from the northbond documentation explains why this was being done: "NOTE: the nb_cli_cfg_change() function clones the candidate configuration before actually editing it. This way, if any error happens during the editing, the original candidate is restored to avoid inconsistencies. Either all changes from the configuration command are performed successfully or none are. It's like a mini-transaction but happening on the candidate configuration (thus the northbound callbacks are not involved)". The problem is that this kind of error handling is just too expensive. A command should never fail to edit the candidate configuration unless there's a bug in the code (e.g. when the CLI wrapper command passes an integer value that YANG rejects due to a "range" statement). In such cases, a command might fail to be applied or applied only partially if it edits multiple YANG nodes. When that happens, just log an error to make the operator aware of the problem, but otherwise ignore it instead of rejecting the command and restoring the candidate to its previous state. We shouldn't add an extreme overhead to the northbound CLI client only to handle errors that should never happen in practice. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/command.c')
0 files changed, 0 insertions, 0 deletions