From: Yuval Lifshitz Date: Thu, 14 Jan 2021 10:41:14 +0000 (+0200) Subject: rgw/amqp: fix race condition in amqp manager initialization X-Git-Tag: v16.1.0~26^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F38903%2Fhead;p=ceph.git rgw/amqp: fix race condition in amqp manager initialization Fixes: https://tracker.ceph.com/issues/48869 Signed-off-by: Yuval Lifshitz --- diff --git a/src/rgw/rgw_amqp.cc b/src/rgw/rgw_amqp.cc index 78446e88f68e..ff30a7841d57 100644 --- a/src/rgw/rgw_amqp.cc +++ b/src/rgw/rgw_amqp.cc @@ -547,9 +547,9 @@ private: std::atomic 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 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