Skip to content

Commit

Permalink
rgw/amqp: fix race condition in amqp manager initialization
Browse files Browse the repository at this point in the history
Fixes: https://tracker.ceph.com/issues/48869

Signed-off-by: Yuval Lifshitz <[email protected]>
  • Loading branch information
yuvalif committed Jan 14, 2021
1 parent cde4444 commit 8c022ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rgw/rgw_amqp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,9 @@ class Manager {
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);
Expand Down Expand Up @@ -819,9 +819,9 @@ class Manager {
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
Expand Down

0 comments on commit 8c022ed

Please sign in to comment.