mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-14 15:58:20 +00:00
vzdump: getlock: return lock file handle and let the caller close it
so it doesn't get out of scope too early.
Regression introduced by 5620e5761e
as pointed
out by Fabian Grünbichler.
Reported in the community forum:
https://forum.proxmox.com/threads/limit-simultaneous-backup-jobs.87489
Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
164651dab6
commit
875c2e5aae
@ -106,7 +106,7 @@ __PACKAGE__->register_method ({
|
||||
$param->{vmids} = $local_vmids;
|
||||
my $vzdump = PVE::VZDump->new($cmdline, $param, $skiplist);
|
||||
|
||||
eval {
|
||||
my $LOCK_FH = eval {
|
||||
$vzdump->getlock($upid); # only one process allowed
|
||||
};
|
||||
if (my $err = $@) {
|
||||
@ -122,6 +122,8 @@ __PACKAGE__->register_method ({
|
||||
}
|
||||
}
|
||||
$vzdump->exec_backup($rpcenv, $user);
|
||||
|
||||
close($LOCK_FH);
|
||||
};
|
||||
|
||||
open STDOUT, '>/dev/null' if $param->{quiet} && !$param->{stdout};
|
||||
|
@ -621,6 +621,8 @@ sub getlock {
|
||||
}
|
||||
|
||||
PVE::Tools::file_set_contents($pidfile, $upid);
|
||||
|
||||
return $SERVER_FLCK;
|
||||
}
|
||||
|
||||
sub run_hook_script {
|
||||
|
Loading…
Reference in New Issue
Block a user