From: pcarana Date: Fri, 13 Mar 2020 16:36:04 +0000 (-0600) Subject: Stop holding the write lock when the SLURM is loaded X-Git-Tag: v1.2.1~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0ca3e568ecd9778775d6c5d2bef04ca8546394df;p=thirdparty%2FFORT-validator.git Stop holding the write lock when the SLURM is loaded There's no need to hold the lock, the SLURM loading action doesn't modify the current DB state; it's altering the new DB state, which will be utilized later to replace the current DB state (and that's where the lock is needed). --- diff --git a/src/rtr/db/vrps.c b/src/rtr/db/vrps.c index be7f3bdd..03ed98ee 100644 --- a/src/rtr/db/vrps.c +++ b/src/rtr/db/vrps.c @@ -289,14 +289,14 @@ __vrps_update(bool *changed) if (error) return error; - rwlock_write_lock(&state_lock); - error = slurm_apply(&new_base, &state.slurm); if (error) { rwlock_unlock(&state_lock); goto revert_base; } + rwlock_write_lock(&state_lock); + if (state.base != NULL) { error = compute_deltas(state.base, new_base, &deltas); if (error) {