logger().warn("active conn reset {}", conn->get_peer_addr());
active_con.reset();
return reopen_session(-1).then([this] {
- send_pendings();
+ if (active_con) {
+ send_pendings();
+ }
return seastar::now();
});
} else {
} else {
logger().warn("mon.{} went away", cur_mon);
return reopen_session(-1).then([this] {
- send_pendings();
+ if (active_con) {
+ send_pendings();
+ }
return seastar::now();
});
}
seastar::future<> Client::authenticate()
{
return reopen_session(-1).then([this] {
- send_pendings();
+ if (active_con) {
+ send_pendings();
+ }
return seastar::now();
});
}
void Client::send_pendings()
{
- if (active_con) {
- for (auto& m : pending_messages) {
- (void) active_con->get_conn()->send(m.msg);
- m.pr.set_value();
- }
- pending_messages.clear();
+ for (auto& m : pending_messages) {
+ (void) active_con->get_conn()->send(m.msg);
+ m.pr.set_value();
}
+ pending_messages.clear();
}
bool Client::sub_want(const std::string& what, version_t start, unsigned flags)