When the configuration node is entered in file-lock mode, candidate
and running datastores are locked. Any configuration change is followed
by an implicit commit which leads to a crash of mgmtd, because double
lock is prohibited by an assert. When working in file-lock mode, we
shouldn't do implicit commits which is disabled by allowing pending
configuration changes.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
}
assert(vty->mgmt_locked_candidate_ds);
assert(vty->mgmt_locked_running_ds);
+
+ /*
+ * As datastores are locked explicitly, we don't need implicit
+ * commits and should allow pending changes.
+ */
+ vty->pending_allowed = true;
}
vty->node = CONFIG_NODE;
/* TODO: could we check for un-commited changes here? */
+ vty->pending_allowed = false;
+
if (vty->mgmt_locked_running_ds)
vty_mgmt_unlock_running_inline(vty);