Why is listing snapshots locking by default?

Hi,
out of curiousity: I noticed that a “restic snapshots” is an operation that is locking by default (–no-lock=false).
As this should be a read only operation, i am wondering what is the reason that there is a repository lock during that operation? Am i missing something i don’t have in mind right now? Are there any drawbacks of using the --no-lock switch?

By creating a lock, restic can ensure that no concurrent forget run can delete snapshots while listing them. This is not really a problem, but would result in a few warnings if both commands run concurrently. Besides that there shouldn’t be any problem.

2 Likes