cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
52
Views
0
Helpful
0
Replies
Highlighted
Cisco Employee

'wait-for-lock' by config or ncs.conf

Hi. I want an advice from someone who are familiar with 'wait-for-lock' which has been implemented since NSO 4.4.2 as follows.

- ncs: 'sync-from'/'sync-to'/'check-sync'/'partial-sync-from' actions now
have a 'wait-for-lock' parameter that can be used to specify a timeout
that the action waits until the device lock is released and any commit
queue items that contain the device are done. If the 'wait-for-lock'
parameter is not specified, the action will fail immediately for the
device if the lock is taken for the device or if the device is placed
in the commit queue.

A commit now use the /devices/global-settings/commit-retries to wait
for any device lock to be released.

(Issue tracker: #27591)

When compare-config and sync-to are executed almost at the same time (compare-config first, sync-to second), sync-to fails as follows because device is locked in a compare-config-operation.

# devices device R1 sync-to
result false
info R1: Device is locked in a compare-config operation by session 328060

This can be solved by adding 'wait-for-lock' option as follows.

# devices device R1 sync-to wait-for-lock { timeout 60 }
# (Success after waiting for device unlocked)

I was expecting this is also achieved by /devices/global-settings/commit-retries setting because above statement says so.

(config)# devices global-settings commit-retries timeout 60
(config)# commit
Commit complete.

But it doesn't work as follows.

# devices device R1 sync-to
result false
info R1: Device is locked in a compare-config operation by session 328630

Is it any way to achieve it by config or ncs.conf setting?