diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2019-09-17 02:51:11 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2019-09-18 19:35:10 +0200 |
commit | 8685be73e039dcb1b754e1fe21be96f60867219a (patch) | |
tree | 2f2bbd346162ed7672faefd0543211eec4c2ebd1 /lib/northbound_confd.c | |
parent | lib: introduce new 'pre_validate' northbound callback (diff) | |
download | frr-8685be73e039dcb1b754e1fe21be96f60867219a.tar.xz frr-8685be73e039dcb1b754e1fe21be96f60867219a.zip |
Revert "lib: introduce a read-write lock for northbound configurations"
Adding a lock to protect the global running configuration doesn't
help much since the FRR daemons are not prepared to process
configuration changes in a pthread that is not the main one (a
whole lot of new protections would be necessary to prevent race
conditions).
This means the lock added by commit 83981138 only adds more
complexity for no benefit. Remove it now to simplify the code.
All northbound clients, including the gRPC one, should either run
in the main pthread or use synchronization primitives to process
configuration transactions in the main pthread.
This reverts commit 83981138fe8c1e0a40b8dede74eca65449dda5de.
Diffstat (limited to 'lib/northbound_confd.c')
-rw-r--r-- | lib/northbound_confd.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/northbound_confd.c b/lib/northbound_confd.c index e9669fc7e..2fc3c81cf 100644 --- a/lib/northbound_confd.c +++ b/lib/northbound_confd.c @@ -289,11 +289,7 @@ static int frr_confd_cdb_read_cb_prepare(int fd, int *subp, int reslen) struct cdb_iter_args iter_args; int ret; - pthread_rwlock_rdlock(&running_config->lock); - { - candidate = nb_config_dup(running_config); - } - pthread_rwlock_unlock(&running_config->lock); + candidate = nb_config_dup(running_config); /* Iterate over all configuration changes. */ iter_args.candidate = candidate; |