int reply_rc;
bufferlist reply_bl;
entity_inst_t reply_from;
+Context *resend_event = 0;
// watch
reply_rc = ack->r;
reply_bl = ack->get_data();
cond.Signal();
+ if (resend_event) {
+ timer.cancel_event(resend_event);
+ resend_event = 0;
+ }
lock.Unlock();
}
}
}
} dispatcher;
+void send_command();
+struct C_Resend : public Context {
+ void finish(int) {
+ monmap.pick_mon(true); // pick a new mon
+ if (!reply)
+ send_command();
+ }
+};
void send_command()
{
MMonCommand *m = new MMonCommand(monmap.fsid);
int mon = monmap.pick_mon();
generic_dout(0) << "mon" << mon << " <- " << pending_cmd << dendl;
messenger->send_message(m, monmap.get_inst(mon));
+
+ resend_event = new C_Resend;
+ timer.add_event_after(5.0, resend_event);
}
int do_command(vector<string>& cmd, bufferlist& bl, string& rs, bufferlist& rbl)
}
+
void usage()
{
cerr << "usage: cmonctl [options] monhost] command" << std::endl;