From: Rongqi Sun Date: Mon, 5 Aug 2024 08:03:40 +0000 (+0800) Subject: Revert "reef: rgw/amqp: lock erase and create connection before emplace" X-Git-Tag: testing/wip-xiubli-testing-20240806.002022-reef~13^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e16a2773120938c84cf293329edf02071cc8d2d5;p=ceph-ci.git Revert "reef: rgw/amqp: lock erase and create connection before emplace" Signed-off-by: Rongqi Sun --- diff --git a/src/rgw/rgw_amqp.cc b/src/rgw/rgw_amqp.cc index f8b826213d2..3014edd1db0 100644 --- a/src/rgw/rgw_amqp.cc +++ b/src/rgw/rgw_amqp.cc @@ -535,12 +535,9 @@ typedef boost::lockfree::queue(cct, info, verify_ssl, ca_location); - if (new_state(conn.get(), tmp_id)) { - ldout(cct, 10) << "AMQP connect: new connection is created. Total connections: " << connection_count << dendl; - } else { - ldout(cct, 1) << "AMQP connect: new connection '" << to_string(tmp_id) << "' is created. but state creation failed (will retry). error: " << - status_to_string(conn->status) << " (" << conn->reply_code << ")" << dendl; + auto conn = connections.emplace(tmp_id, std::make_unique(cct, info, verify_ssl, ca_location)).first->second.get(); + ldout(cct, 10) << "AMQP connect: new connection is created. Total connections: " << connection_count << dendl; + if (!new_state(conn, tmp_id)) { + ldout(cct, 1) << "AMQP connect: new connection '" << to_string(tmp_id) << "' is created. but state creation failed (will retry). error: " << + status_to_string(conn->status) << " (" << conn->reply_code << ")" << dendl; } - connections.emplace(tmp_id, std::move(conn)); id = std::move(tmp_id); return true; }