ClientRequest::get_connection() return l_conn, which will be
null by the time PG::add_client_request_lat is called in
ClientRequest::do_process. Modify get_connection() to
return a Connection& from whichever of l_conn or r_conn
isn't null.
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit
794bb024efa94cb2bb2a90df226bab05c8b9449b)
static_assert(std::is_same_v<T, MOSDOp>);
return m.get();
}
- const crimson::net::ConnectionRef &get_connection() const {
- return l_conn;
+ const crimson::net::Connection &get_connection() const {
+ if (l_conn) {
+ return *l_conn;
+ } else {
+ assert(r_conn);
+ return *r_conn;
+ }
}
/**
break;
case OSDPerfMetricSubKeyType::CLIENT_ADDRESS:
#ifdef WITH_CRIMSON
- match_string = stringify(op.get_connection()->get_peer_addr());
+ match_string = stringify(op.get_connection().get_peer_addr());
#else
match_string = stringify(m->get_connection()->get_peer_addr());
#endif