With multiple threads of execution possible, we need to ensure that
all completions have fired prior to the destruction of the AsioEngine.
We also need to ensure that the AsioEngine is destoyed outside the
context of its owned stands.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
delete state;
delete plugin_registry;
+
+ // destroy our AsioEngine via its shared io_context to ensure that we
+ // aren't executing within an AsioEngine-owned strand
+ auto& io_context = asio_engine->get_io_context();
+ boost::asio::post(io_context, [asio_engine=std::move(asio_engine)]() {});
}
void ImageCtx::init() {
ContextWQ::~ContextWQ() {
ldout(m_cct, 20) << dendl;
+ drain();
}
void ContextWQ::drain() {