mirror_frr/vtysh
Igor Ryzhov 0db4d555e9 mgmtd, vtysh: fix possible conflict when reading the config
When FRR starts, after mgmtd is initialized, backend clients connect to
it and request their config. To supply the config, mgmtd creates a
configuration transaction. At the same time, `vtysh -b` tries to read
the startup config and configure mgmtd, which also creates a
configuration transaction. If these two actions happen at the exact same
time, there's a conflict between them, because only a single
configuration translaction is allowed. Because of that, vtysh fails and
the config is completely ignored.

When starting the config reading, vtysh locks candidate and running
datastores in mgmtd. This commit adds locking of running datastore when
initializing the backend client. It allows to retry locking on the vtysh
side and read the config only when the lock is aquired instead of
failing.

This change also prevents running datastore from being changed during
initialization of backend clients. This could lead to a desynchronized
state between mgmtd and backends.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-02-07 18:37:29 +02:00
..
.gitignore lib,vtysh: add per-daemon log file config 2024-01-17 16:15:07 -05:00
daemons.pl *: manual SPDX License ID conversions 2023-02-09 14:09:07 +01:00
Makefile build: non-recursive vtysh 2018-09-08 21:26:54 +02:00
subdir.am lib,vtysh: add per-daemon log file config 2024-01-17 16:15:07 -05:00
vtysh_config.c mgmtd, vtysh: fix possible conflict when reading the config 2024-02-07 18:37:29 +02:00
vtysh_main.c *: rename frr_vtydir to frr_runstatedir 2024-01-27 19:01:19 +01:00
vtysh_user.c vtysh: Give actual pam error messages 2023-05-26 07:44:11 -04:00
vtysh_user.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
vtysh.c vtysh: un-hide the show configuration nb cli 2024-01-30 08:09:25 -05:00
vtysh.h zebra: convert to mgmtd 2024-01-28 23:28:40 +02:00