]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RGWPeriodPusher spawns http thread before cr thread 14936/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 3 May 2017 15:32:34 +0000 (11:32 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 3 May 2017 15:32:38 +0000 (11:32 -0400)
Fixes: http://tracker.ceph.com/issues/19834
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_period_pusher.cc

index d6b2eabec392071ab7864b0aaa37cdf5b23c63bb..75b454cf1c68a311855685c3d43f6eb33ef24fa6 100644 (file)
@@ -135,10 +135,11 @@ class RGWPeriodPusher::CRThread {
            std::map<std::string, RGWRESTConn>&& conns)
     : coroutines(cct, NULL),
       http(cct, coroutines.get_completion_mgr()),
-      push_all(new PushAllCR(cct, &http, std::move(period), std::move(conns))),
-      thread([this] { coroutines.run(push_all.get()); })
+      push_all(new PushAllCR(cct, &http, std::move(period), std::move(conns)))
   {
     http.set_threaded();
+    // must spawn the CR thread after set_threaded
+    thread = std::thread([this] { coroutines.run(push_all.get()); });
   }
   ~CRThread()
   {