From 707a6c6ff6dc70884f3da30e9f31fe5360c2486b Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 21 Jan 2014 12:11:25 +0100 Subject: [PATCH] ceph: re-open rados connection inside worker process --- PVE/API2/Ceph.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm index b66cbe5fa..3b64eaa74 100644 --- a/PVE/API2/Ceph.pm +++ b/PVE/API2/Ceph.pm @@ -825,6 +825,8 @@ __PACKAGE__->register_method ({ my $worker = sub { my $upid = shift; + $rados = PVE::RADOS->new(); # reopen + $rados->mon_command({ prefix => "mon remove", name => $monid, format => 'plain' }); eval { &$ceph_service_cmd('stop', $monsection); }; @@ -1286,7 +1288,6 @@ __PACKAGE__->register_method ({ my $bindata = $rados->mon_command({ prefix => 'auth get client.bootstrap-osd', format => 'plain' }); PVE::Tools::file_set_contents($ceph_bootstrap_osd_keyring, $bindata); }; - my $worker = sub { my $upid = shift; @@ -1372,6 +1373,8 @@ __PACKAGE__->register_method ({ my $worker = sub { my $upid = shift; + $rados = PVE::RADOS->new(); # reopen + print "destroy OSD $osdsection\n"; eval { &$ceph_service_cmd('stop', $osdsection); };