Skip to content

Commit

Permalink
use longer rados timeouts when inside worker tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
maurerdietmar committed Jan 22, 2014
1 parent 974cad5 commit 4e331f7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions PVE/API2/Ceph.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ my $ceph_bin = "/usr/bin/ceph";

my $pve_osd_default_journal_size = 1024*5;

# we can use longer rados timeout when inside workers
my $long_rados_timeout = 60;

my $verify_blockdev_path = sub {
my ($path) = @_;

Expand Down Expand Up @@ -749,7 +752,7 @@ __PACKAGE__->register_method ({
mkdir $mondir;

if ($moncount > 0) {
my $rados = PVE::RADOS->new();
my $rados = PVE::RADOS->new(timeout => $long_rados_timeout);
my $mapdata = $rados->mon_command({ prefix => 'mon getmap', format => 'plain' });
PVE::Tools::file_set_contents($monmap, $mapdata);
} else {
Expand Down Expand Up @@ -825,7 +828,8 @@ __PACKAGE__->register_method ({
my $worker = sub {
my $upid = shift;

$rados = PVE::RADOS->new(); # reopen
# reopen with longer timeout
$rados = PVE::RADOS->new(timeout => $long_rados_timeout);

$rados->mon_command({ prefix => "mon remove", name => $monid, format => 'plain' });

Expand Down Expand Up @@ -1373,7 +1377,8 @@ __PACKAGE__->register_method ({
my $worker = sub {
my $upid = shift;

$rados = PVE::RADOS->new(); # reopen
# reopen with longer timeout
$rados = PVE::RADOS->new(timeout => $long_rados_timeout);

print "destroy OSD $osdsection\n";

Expand Down

0 comments on commit 4e331f7

Please sign in to comment.