Skip to content

Commit 9a45a0b

Browse files
committed
crimson/net/Messenger: add the "mark_down" interface
Signed-off-by: Xuehan Xu <[email protected]>
1 parent 530a260 commit 9a45a0b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/crimson/net/Messenger.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class Messenger {
5757

5858
virtual void set_auth_server(crimson::auth::AuthServer *) = 0;
5959

60+
virtual seastar::future<> mark_down(const entity_addr_t &addr) = 0;
61+
6062
using bind_ertr = crimson::errorator<
6163
crimson::ct_error::address_in_use, // The address (range) is already bound
6264
crimson::ct_error::address_not_available

src/crimson/net/SocketMessenger.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,18 @@ class SocketMessenger final : public Messenger {
152152
Interceptor *interceptor = nullptr;
153153
#endif
154154

155+
seastar::future<> mark_down(const entity_addr_t& a) final {
156+
auto conn = lookup_conn(a);
157+
if (conn) {
158+
return seastar::smp::submit_to(
159+
conn->get_shard_id(),
160+
[conn=conn.get()] {
161+
conn->mark_down();
162+
return seastar::now();
163+
}).then([conn] { return seastar::now(); });
164+
}
165+
return seastar::now();
166+
}
155167
private:
156168
seastar::future<> accept(SocketFRef &&, const entity_addr_t &);
157169

0 commit comments

Comments
 (0)