]> git.proxmox.com Git - pve-storage.git/commitdiff
RBD plugin: librados connect: increase timeout when in worker
authorFiona Ebner <f.ebner@proxmox.com>
Fri, 2 Sep 2022 07:33:07 +0000 (09:33 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 13 Sep 2022 07:57:19 +0000 (09:57 +0200)
The default timeout in PVE/RADOS.pm is 5 seconds, but this is not
always enough for external clusters under load. Workers can and should
take their time to not fail here too quickly.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
PVE/Storage/RBDPlugin.pm

index aaacb17cab7b8a2478e6e9e37a2ee15dd2ba0a18..dc6e79d1dac88b47753f7af02e1c3c60be6d7ef1 100644 (file)
@@ -13,6 +13,7 @@ use PVE::Cluster qw(cfs_read_file);;
 use PVE::JSONSchema qw(get_standard_option);
 use PVE::ProcFSTools;
 use PVE::RADOS;
+use PVE::RPCEnvironment;
 use PVE::Storage::Plugin;
 use PVE::Tools qw(run_command trim file_read_firstline);
 
@@ -27,6 +28,9 @@ my $get_parent_image_name = sub {
 my $librados_connect = sub {
     my ($scfg, $storeid, $options) = @_;
 
+    $options->{timeout} = 60
+       if !defined($options->{timeout}) && PVE::RPCEnvironment->is_worker();
+
     my $librados_config = PVE::CephConfig::ceph_connect_option($scfg, $storeid, $options->%*);
 
     my $rados = PVE::RADOS->new(%$librados_config);