{
dout(20) << "on_finish=" << on_finish << dendl;
+ image_replayer::BootstrapRequest<I> *bootstrap_request = nullptr;
bool shut_down_replay = false;
bool running = true;
{
if (m_state == STATE_STARTING) {
dout(20) << "canceling start" << dendl;
if (m_bootstrap_request) {
- m_bootstrap_request->cancel();
+ bootstrap_request = m_bootstrap_request;
+ bootstrap_request->get();
}
} else {
dout(20) << "interrupting replay" << dendl;
}
}
+ // avoid holding lock since bootstrap request will update status
+ if (bootstrap_request != nullptr) {
+ bootstrap_request->cancel();
+ bootstrap_request->put();
+ }
+
if (!running) {
dout(20) << "not running" << dendl;
if (on_finish) {
{
Context *on_req_finish = new FunctionContext(
[this](int r) {
+ dout(20) << "replay status ready: r=" << r << dendl;
if (r >= 0) {
- dout(20) << "replay status ready" << dendl;
send_mirror_status_update(boost::none);
+ } else if (r == -EAGAIN) {
+ // decrement in-flight status update counter
+ handle_mirror_status_update(r);
}
});