mirror of
https://github.com/ceph/ceph
synced 2025-01-19 01:21:49 +00:00
crimson/mon: pending_messages should not be empty if active_conn
we always send all pending_messages, and clear it when establishing a connection to mon, so there is no need to check for it when calling `send_message()`. Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
83d2e322a3
commit
aea159c626
@ -1011,13 +1011,12 @@ Client::run_command(const std::vector<std::string>& cmd,
|
||||
seastar::future<> Client::send_message(MessageRef m)
|
||||
{
|
||||
if (active_con) {
|
||||
if (!pending_messages.empty()) {
|
||||
send_pendings();
|
||||
}
|
||||
assert(pending_messages.empty());
|
||||
return active_con->get_conn()->send(m);
|
||||
} else {
|
||||
auto& delayed = pending_messages.emplace_back(m);
|
||||
return delayed.pr.get_future();
|
||||
}
|
||||
auto& delayed = pending_messages.emplace_back(m);
|
||||
return delayed.pr.get_future();
|
||||
}
|
||||
|
||||
void Client::send_pendings()
|
||||
|
Loading…
Reference in New Issue
Block a user