Skip to content

Commit da409bb

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

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/crimson/mgr/client.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ seastar::future<> Client::stop()
4141
{
4242
logger().info("{}", __func__);
4343
report_timer.cancel();
44-
auto fut = gate.close();
44+
auto fut = gates.close_all();
4545
if (conn) {
4646
conn->mark_down();
4747
}
@@ -52,7 +52,7 @@ std::optional<seastar::future<>>
5252
Client::ms_dispatch(crimson::net::ConnectionRef conn, MessageRef m)
5353
{
5454
bool dispatched = true;
55-
gate.dispatch_in_background(__func__, *this, [this, conn, &m, &dispatched] {
55+
gates.dispatch_in_background(__func__, *this, [this, conn, &m, &dispatched] {
5656
switch(m->get_type()) {
5757
case MSG_MGR_MAP:
5858
return handle_mgr_map(conn, boost::static_pointer_cast<MMgrMap>(m));
@@ -71,7 +71,7 @@ void Client::ms_handle_connect(
7171
seastar::shard_id prv_shard)
7272
{
7373
ceph_assert_always(prv_shard == seastar::this_shard_id());
74-
gate.dispatch_in_background(__func__, *this, [this, c] {
74+
gates.dispatch_in_background(__func__, *this, [this, c] {
7575
if (conn == c) {
7676
// ask for the mgrconfigure message
7777
auto m = crimson::make_message<MMgrOpen>();
@@ -87,7 +87,7 @@ void Client::ms_handle_connect(
8787

8888
void Client::ms_handle_reset(crimson::net::ConnectionRef c, bool /* is_replace */)
8989
{
90-
gate.dispatch_in_background(__func__, *this, [this, c] {
90+
gates.dispatch_in_background(__func__, *this, [this, c] {
9191
if (conn == c) {
9292
report_timer.cancel();
9393
return reconnect();
@@ -158,7 +158,7 @@ seastar::future<> Client::handle_mgr_conf(crimson::net::ConnectionRef,
158158
void Client::report()
159159
{
160160
_send_report();
161-
gate.dispatch_in_background(__func__, *this, [this] {
161+
gates.dispatch_in_background(__func__, *this, [this] {
162162
if (!conn) {
163163
logger().warn("report: no conn available; report skipped");
164164
return seastar::now();
@@ -178,7 +178,7 @@ void Client::_send_report()
178178
{
179179
// TODO: implement daemon_health_metrics support
180180
// https://tracker.ceph.com/issues/63766
181-
gate.dispatch_in_background(__func__, *this, [this] {
181+
gates.dispatch_in_background(__func__, *this, [this] {
182182
if (!conn) {
183183
logger().warn("cannot send report; no conn available");
184184
return seastar::now();

src/crimson/mgr/client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Client : public crimson::net::Dispatcher {
5555
WithStats& with_stats;
5656
crimson::net::ConnectionRef conn;
5757
seastar::timer<seastar::lowres_clock> report_timer;
58-
crimson::common::Gated gate;
58+
crimson::common::gate_per_shard gates;
5959
uint64_t last_config_bl_version = 0;
6060
std::string service_name, daemon_name;
6161

0 commit comments

Comments
 (0)