#include "auth/AuthMethodList.h"
#include "auth/RotatingKeyRing.h"
-
#define dout_subsys ceph_subsys_monc
#undef dout_prefix
#define dout_prefix *_dout << "monclient" << (_hunting() ? "(hunting)":"") << ": "
Dispatcher(cct_),
messenger(NULL),
monc_lock("MonClient::monc_lock"),
- timer(cct_, monc_lock), finisher(cct_),
+ timer(cct_, monc_lock),
+ finisher(cct_),
initialized(false),
no_keyring_disabled_cephx(false),
log_client(NULL),
switch (m->get_type()) {
case CEPH_MSG_MON_MAP:
handle_monmap(static_cast<MMonMap*>(m));
+ if (passthrough_monmap) {
+ return false;
+ } else {
+ m->put();
+ }
break;
case CEPH_MSG_AUTH_REPLY:
handle_auth(static_cast<MAuthReply*>(m));
send_log();
}
+/* Unlike all the other message-handling functions, we don't put away a reference
+* because we want to support MMonMap passthrough to other Dispatchers. */
void MonClient::handle_monmap(MMonMap *m)
{
ldout(cct, 10) << __func__ << " " << *m << dendl;
map_cond.Signal();
want_monmap = false;
-
- m->put();
}
// ----------------------
delete version_requests.begin()->second;
version_requests.erase(version_requests.begin());
}
-
+ while (!mon_commands.empty()) {
+ auto tid = mon_commands.begin()->first;
+ _cancel_mon_command(tid);
+ }
while (!waiting_for_session.empty()) {
ldout(cct, 20) << __func__ << " discarding pending message " << *waiting_for_session.front() << dendl;
waiting_for_session.front()->put();
ack->put();
}
-int MonClient::_cancel_mon_command(uint64_t tid, int r)
+int MonClient::_cancel_mon_command(uint64_t tid)
{
assert(monc_lock.is_locked());
public:
C_CancelMonCommand(uint64_t tid, MonClient *monc) : tid(tid), monc(monc) {}
void finish(int r) override {
- monc->_cancel_mon_command(tid, -ETIMEDOUT);
+ monc->_cancel_mon_command(tid);
}
};
r->ontimeout = new C_CancelMonCommand(r->tid, this);