From 8685be73e039dcb1b754e1fe21be96f60867219a Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Mon, 16 Sep 2019 21:51:11 -0300 Subject: 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. --- lib/libfrr.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/libfrr.c') diff --git a/lib/libfrr.c b/lib/libfrr.c index 478fe4e205..d4aa1f899a 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -868,12 +868,7 @@ static int frr_config_read_in(struct thread *t) /* * Update the shared candidate after reading the startup configuration. */ - pthread_rwlock_rdlock(&running_config->lock); - { - nb_config_replace(vty_shared_candidate_config, running_config, - true); - } - pthread_rwlock_unlock(&running_config->lock); + nb_config_replace(vty_shared_candidate_config, running_config, true); return 0; } -- cgit v1.2.3