]> 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:42:35 +0000 (12:42 +0200)
commit34b23d4627e57f1c5a8e4c88224ebb74a1815879
tree4c9a71b8c2ca96108546a3c6916692b3b104e049
parent8a3cd03242ad20c4511ea9cbe635902b2b78f2d9
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>
data/PVE/API2/ClusterConfig.pm