diff --git a/src/rgw/rgw_flight_frontend.cc b/src/rgw/rgw_flight_frontend.cc index 61defbdd662..c29703fe513 100644 --- a/src/rgw/rgw_flight_frontend.cc +++ b/src/rgw/rgw_flight_frontend.cc @@ -49,7 +49,11 @@ FlightFrontend::FlightFrontend(RGWProcessEnv& _env, FlightFrontend::~FlightFrontend() { delete env.flight_server; + env.flight_server = nullptr; + delete env.flight_store; + env.flight_store = nullptr; + INFO << "flight server shut down" << dendl; } diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 5bb0d398822..311b629a3df 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -2237,10 +2237,14 @@ void RGWGetObj::execute(optional_yield y) } #ifdef WITH_ARROW_FLIGHT - if (ofs == 0) { - // insert a GetObj_Filter to monitor and create flight - flight_filter.emplace(s, filter); - filter = &*flight_filter; + if (s->penv.flight_store) { + if (ofs == 0) { + // insert a GetObj_Filter to monitor and create flight + flight_filter.emplace(s, filter); + filter = &*flight_filter; + } + } else { + ldpp_dout(this, 0) << "ERROR: flight_store not created in " << __func__ << dendl; } #endif diff --git a/src/rgw/rgw_process_env.h b/src/rgw/rgw_process_env.h index 7e3abad65a7..4becf21a10f 100644 --- a/src/rgw/rgw_process_env.h +++ b/src/rgw/rgw_process_env.h @@ -43,8 +43,8 @@ struct RGWProcessEnv { #ifdef WITH_ARROW_FLIGHT // managed by rgw:flight::FlightFrontend in rgw_flight_frontend.cc - rgw::flight::FlightServer* flight_server; - rgw::flight::FlightStore* flight_store; + rgw::flight::FlightServer* flight_server = nullptr; + rgw::flight::FlightStore* flight_store = nullptr; #endif };