Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
set -lockfile using CSILVM_LOCKFILE_PATH env var
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustav Paul committed Aug 9, 2019
1 parent ca19ff8 commit 50c26b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ It is expected that the CO will connect to the plugin through the unix socket an

### Locking

If the `-lockfile` parameter is specified, an exclusive `flock()` is held on
that file whenever any lvm2 command-line utility is invoked. This prevents
If the `-lockfile` parameter is specified or the `CSILVM_LOCKFILE_PATH` environment variable is set,
an exclusive `flock()` is held on that file whenever any lvm2 command-line utility is invoked. This prevents
multiple CSILVM processes from performing concurrent lvm operations that can
lead to deadlocks in the underlying lvm2 implementation. For example,
https://jira.mesosphere.com/browse/DCOS_OSS-5434 and
Expand Down
2 changes: 2 additions & 0 deletions cmd/csilvm/csilvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ func main() {
// - https://github.com/lvmteam/lvm2/issues/23
if *lockFilePathF != "" {
lvm.SetLockFilePath(*lockFilePathF)
} else if path := os.Getenv("CSILVM_LOCKFILE_PATH"); path != "" {
lvm.SetLockFilePath(path)
}
// Determine listen address.
if *socketFileF != "" && *socketFileEnvF != "" {
Expand Down

0 comments on commit 50c26b9

Please sign in to comment.