summaryrefslogtreecommitdiff
path: root/lib/northbound_sysrepo.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-09-16 21:51:11 -0300
committerRenato Westphal <renato@opensourcerouting.org>2019-09-18 14:35:10 -0300
commit8685be73e039dcb1b754e1fe21be96f60867219a (patch)
tree2f2bbd346162ed7672faefd0543211eec4c2ebd1 /lib/northbound_sysrepo.c
parent34224f0c5c7259e0b880d48ea4a0c171997598bb (diff)
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_sysrepo.c')
-rw-r--r--lib/northbound_sysrepo.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/northbound_sysrepo.c b/lib/northbound_sysrepo.c
index 77183282ba..b94c939763 100644
--- a/lib/northbound_sysrepo.c
+++ b/lib/northbound_sysrepo.c
@@ -256,11 +256,7 @@ static int frr_sr_config_change_cb_verify(sr_session_ctx_t *session,
return 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);
while ((ret = sr_get_change_next(session, it, &sr_op, &sr_old_val,
&sr_new_val))