[pve-devel] applied: [PATCH manager] replication: use a dedicated lock file

Dietmar Maurer dietmar at proxmox.com
Fri Jun 2 06:01:33 CEST 2017


First, thanks for finding this bug! I applied it with minor 
changes.

> On June 1, 2017 at 3:26 PM Wolfgang Bumiller <w.bumiller at proxmox.com> wrote:
> 
> 
> Otherwise $update_job_state's file_set_contents() call
> drops our lock.
> ---
>  PVE/Replication.pm             | 5 +++--
>  bin/test/ReplicationTestEnv.pm | 2 ++
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/PVE/Replication.pm b/PVE/Replication.pm
> index 96c54b09..9256177c 100644
> --- a/PVE/Replication.pm
> +++ b/PVE/Replication.pm
> @@ -22,6 +22,7 @@ use PVE::ReplicationConfig;
>  
>  # Note: regression tests can overwrite $state_path for testing
>  our $state_path = "/var/lib/pve-manager/pve-replication-state.json";
> +our $lock_file = "/var/lock/pve-replication";

I used the following instead:

my $pvesr_lock_file = "/var/lock/pvesr.lck";

Because we will need another lock for state file to allow
more fine grained locking (patch follows).




More information about the pve-devel mailing list