Skip to content

Commit 6b04b96

Browse files
committed
crimson/osd: cancel IO reservations on PG::stop().
`PG::request_{local,remote}_recovery_reservation()` dynamically allocates up to 2 instances of `LambdaContext<T>` and transfers their ownership to the `AsyncReserver<T, F>`. This is expressed in raw pointers (`new` and `delete`) notion. Further analysis shows the only place where `delete` for these objects is called is the `AsyncReserver::cancel_reservation()`. In contrast to the classical OSD, crimson doesn't invoke the method when stopping a PG during the shutdown sequence. This would explain the following ASan issue observed at Sepia: ``` Direct leak of 576 byte(s) in 24 object(s) allocated from: #0 0x7fa108fc57b0 in operator new(unsigned long) (/lib64/libasan.so.5+0xf17b0) #1 0x55723d8b0b56 in non-virtual thunk to crimson::osd::PG::request_local_background_io_reservation(unsigned int, std::unique_ptr<PGPeeringEvent, std::default_delete<PGPeeringEvent> >, std::unique_ptr<PGPeeringEvent, std::default_delete<PGPeeringEvent> >) (/usr/bin/ceph-osd+0x24d95b56) #2 0x55723f1f66ef in PeeringState::WaitDeleteReserved::WaitDeleteReserved(boost::statechart::state<PeeringState::WaitDeleteReserved, PeeringState::ToDelete, boost::mpl::list<mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, (boost::statechart::history_mode)0>::my_context) (/usr/bin/ceph-osd+0x266db6ef) ``` Signed-off-by: Radoslaw Zarzynski <[email protected]>
1 parent a24b3fa commit 6b04b96

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/crimson/osd/pg.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,8 @@ seastar::future<> PG::stop()
11531153
{
11541154
logger().info("PG {} {}", pgid, __func__);
11551155
stopping = true;
1156+
cancel_local_background_io_reservation();
1157+
cancel_remote_recovery_reservation();
11561158
check_readable_timer.cancel();
11571159
renew_lease_timer.cancel();
11581160
return osdmap_gate.stop().then([this] {

0 commit comments

Comments
 (0)