]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/amqp: fix race condition in amqp manager initialization 38903/head
authorYuval Lifshitz <ylifshit@redhat.com>
Thu, 14 Jan 2021 10:41:14 +0000 (12:41 +0200)
committerYuval Lifshitz <ylifshit@redhat.com>
Thu, 14 Jan 2021 10:41:14 +0000 (12:41 +0200)
Fixes: https://tracker.ceph.com/issues/48869
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
src/rgw/rgw_amqp.cc

index 78446e88f68e667443406700a2659aafdabb57cf..ff30a7841d57260e8fc1123a58b839242031535d 100644 (file)
@@ -547,9 +547,9 @@ private:
   std::atomic<size_t> dequeued;
   CephContext* const cct;
   mutable std::mutex connections_lock;
-  std::thread runner;
   const ceph::coarse_real_clock::duration idle_time;
   const ceph::coarse_real_clock::duration reconnect_time;
+  std::thread runner;
 
   void publish_internal(message_wrapper_t* message) {
     const std::unique_ptr<message_wrapper_t> msg_owner(message);
@@ -819,9 +819,9 @@ public:
     queued(0),
     dequeued(0),
     cct(_cct),
-    runner(&Manager::run, this),
     idle_time(std::chrono::milliseconds(idle_time_ms)),
-    reconnect_time(std::chrono::milliseconds(reconnect_time_ms)) {
+    reconnect_time(std::chrono::milliseconds(reconnect_time_ms)),
+    runner(&Manager::run, this) {
       // The hashmap has "max connections" as the initial number of buckets, 
       // and allows for 10 collisions per bucket before rehash.
       // This is to prevent rehashing so that iterators are not invalidated