dispatch_reset ? "yes" : "no",
is_replace ? "yes" : "no");
- // unregister_conn() drops a reference, so hold another until completion
- auto cleanup = [conn_ref = conn.shared_from_this(), this] {
- logger().debug("{} closed!", conn);
- on_closed();
-#ifdef UNIT_TESTS_BUILT
- is_closed_clean = true;
- if (conn.interceptor) {
- conn.interceptor->register_conn_closed(conn);
- }
-#endif
- };
-
// atomic operations
closed = true;
trigger_close();
} else {
return seastar::now();
}
- }).finally(std::move(cleanup));
+ }).then([this] {
+ logger().debug("{} closed!", conn);
+ on_closed();
+#ifdef UNIT_TESTS_BUILT
+ is_closed_clean = true;
+ if (conn.interceptor) {
+ conn.interceptor->register_conn_closed(conn);
+ }
+#endif
+ }).handle_exception([conn_ref = conn.shared_from_this(), this] (auto eptr) {
+ logger().error("{} closing: close_ready got unexpected exception {}", conn, eptr);
+ ceph_abort();
+ });
}
seastar::future<> Protocol::send(MessageRef msg)
void ProtocolV2::trigger_close()
{
+ messenger.closing_conn(
+ seastar::static_pointer_cast<SocketConnection>(
+ conn.shared_from_this()));
+
if (state == state_t::ACCEPTING || state == state_t::SERVER_WAIT) {
messenger.unaccept_conn(
seastar::static_pointer_cast<SocketConnection>(
}
protocol_timer.cancel();
- messenger.closing_conn(
- seastar::static_pointer_cast<SocketConnection>(
- conn.shared_from_this()));
trigger_state(state_t::CLOSING, write_state_t::drop, false);
}