]> git.proxmox.com Git - pve-cluster.git/commit
API: correctly propagate $@ with nested locks
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 16 Jul 2019 13:43:18 +0000 (15:43 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 17 Jul 2019 10:57:27 +0000 (12:57 +0200)
commit0f147e2a45c47d910ae13a513c58abe908543ae4
treec75e71ba23a49e29ea966b9d409e2192877ca905
parent034a1b111c3cb893cb1690eeb24ca83f53c5e795
API: correctly propagate $@ with nested locks

PVE::Cluster::cfs_lock_file sets $@ and returns undef for all errors,
including when $code dies. PVE::Tools::lock_file runs $code inside an
eval as well, so just setting $@ is not enough when nesting these two
types of locks.

re-die with the inner error to actually propagate error messages and
fail instead of proceeding. this triggered (probably among other cases)
when attempting to join an existing cluster without specifying all
needed links.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(cherry picked from commit 34b23d4627e57f1c5a8e4c88224ebb74a1815879)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
data/PVE/API2/ClusterConfig.pm