Skip to content

Commit 1071cc3

Browse files
committed
crimson/net/io_handler: ctor add gate ctor with shard id
IOHandler::to_new_sid provides a mechanism to switch to a new core from the current one used. This behavior is tricky for making sure that we keep the IOHandler::shard_states_t::gate instance to be used on the same core that it was created. In order to resolve this, we should be able to construct Gated out of specified core_id (and not from this_shard_id). See: ceph#58986 (comment) Signed-off-by: NitzanMordhai <[email protected]>
1 parent d944d32 commit 1071cc3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/crimson/common/gated.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace crimson::common {
1818
class Gated {
1919
public:
2020
Gated() : sid(seastar::this_shard_id()) {}
21+
Gated(const seastar::shard_id sid) : sid(sid) {}
2122
Gated(const Gated&) = delete;
2223
Gated& operator=(const Gated&) = delete;
2324
Gated(Gated&&) = default;

src/crimson/net/io_handler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ class IOHandler final : public ConnectionHandler {
255255
class shard_states_t {
256256
public:
257257
shard_states_t(seastar::shard_id _sid, io_state_t state)
258-
: sid{_sid}, io_state{state} {}
258+
: sid{_sid}, io_state{state}, gate{_sid} {}
259259

260260
seastar::shard_id get_shard_id() const {
261261
return sid;

0 commit comments

Comments
 (0)