Page MenuHomePhabricator

Add functions for commit lock checking
Closed, ResolvedPublicFEATURE REQUEST

Description

Some scripts, like the dhclient script, need to access the running config from outside the normal CLI and assume that the values are up to date.
When such scripts are triggered from config scripts, there's a good chance of a race condition: if they try to get values until commit completes, they will get incorrect results.

Old scripts used returnOrigValue and similar, which meant they were intentionally getting outdated results.

A correct way to do that would be to check if a commit is still in progress and wait until it completes.

if vyos.util.commit_in_progress():
    print("Commit in progress!")

    vyos.util.wait_for_commit_lock()
    print("Commit is no longer in progress")

Details

Difficulty level
Normal (likely a few hours)
Version
-
Why the issue appeared?
Will be filled on close

Event Timeline

dmbaturin created this task.Jul 3 2019, 1:35 AM
dmbaturin changed the task status from Open to Needs testing.Jul 3 2019, 1:48 AM
dmbaturin claimed this task.
dmbaturin triaged this task as High priority.
dmbaturin changed Difficulty level from Unknown (require assessment) to Normal (likely a few hours).
dmbaturin added a subscriber: UnicronNL.
pasik added a subscriber: pasik.Jul 5 2019, 9:52 PM
dmbaturin closed this task as Resolved.Jul 10 2019, 6:12 PM
syncer moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.
syncer moved this task from Needs Triage to Finished on the VyOS 1.2 Crux (VyOS 1.2.3) board.