Skip to content

Commit a8918f3

Browse files
committed
crimson/mon/MonClient: use gates to handle multi-shards
Fixes: https://tracker.ceph.com/issues/67773 Signed-off-by: Nitzan Mordechai <[email protected]>
1 parent da409bb commit a8918f3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/crimson/mon/MonClient.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ seastar::future<> Client::load_keyring()
464464

465465
void Client::tick()
466466
{
467-
gate.dispatch_in_background(__func__, *this, [this] {
467+
gates.dispatch_in_background(__func__, *this, [this] {
468468
if (active_con) {
469469
return seastar::when_all_succeed(wait_for_send_log(),
470470
active_con->get_conn()->send_keepalive(),
@@ -505,7 +505,7 @@ std::optional<seastar::future<>>
505505
Client::ms_dispatch(crimson::net::ConnectionRef conn, MessageRef m)
506506
{
507507
bool dispatched = true;
508-
gate.dispatch_in_background(__func__, *this, [this, conn, &m, &dispatched] {
508+
gates.dispatch_in_background(__func__, *this, [this, conn, &m, &dispatched] {
509509
// we only care about these message types
510510
switch (m->get_type()) {
511511
case CEPH_MSG_MON_MAP:
@@ -538,7 +538,7 @@ Client::ms_dispatch(crimson::net::ConnectionRef conn, MessageRef m)
538538

539539
void Client::ms_handle_reset(crimson::net::ConnectionRef conn, bool /* is_replace */)
540540
{
541-
gate.dispatch_in_background(__func__, *this, [this, conn] {
541+
gates.dispatch_in_background(__func__, *this, [this, conn] {
542542
auto found = std::find_if(pending_conns.begin(), pending_conns.end(),
543543
[peer_addr = conn->get_peer_addr()](auto& mc) {
544544
return mc->is_my_peer(peer_addr);
@@ -941,7 +941,7 @@ seastar::future<> Client::authenticate()
941941
seastar::future<> Client::stop()
942942
{
943943
logger().info("{}", __func__);
944-
auto fut = gate.close();
944+
auto fut = gates.close_all();
945945
timer.cancel();
946946
ready_to_send = false;
947947
for (auto& pending_con : pending_conns) {

src/crimson/mon/MonClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class Client : public crimson::net::Dispatcher,
194194
std::vector<unsigned> get_random_mons(unsigned n) const;
195195
seastar::future<> _add_conn(unsigned rank, uint64_t global_id);
196196
void _finish_auth(const entity_addr_t& peer);
197-
crimson::common::Gated gate;
197+
crimson::common::gate_per_shard gates;
198198

199199
// messages that are waiting for the active_con to be available
200200
struct pending_msg_t {

0 commit comments

Comments
 (0)