assert(m->get_source().is_mon());
whoami = m->get_dest().num();
dout(1) << "handle_mds_map i am now " << m->get_dest() << dendl;
- messenger->reset_myname(m->get_dest());
mount_cond.Signal(); // mount might be waiting for this.
}
client_instance_this_process),
monmap->get_inst(mon));
- // schedule timeout
- assert(mount_timeout_event == 0);
- mount_timeout_event = new C_MountTimeout(this);
- timer.add_event_after(g_conf.client_mount_timeout, mount_timeout_event);
+ // schedule timeout?
+ if (g_conf.num_client <= 1) { // don't do this if we have multiple instances in our process!
+ assert(mount_timeout_event == 0);
+ mount_timeout_event = new C_MountTimeout(this);
+ timer.add_event_after(g_conf.client_mount_timeout, mount_timeout_event);
+ }
}
void Client::_mount_timeout()
!osdmap ||
osdmap->get_epoch() == 0)
mount_cond.Wait(client_lock);
-
- timer.cancel_event(mount_timeout_event);
- mount_timeout_event = 0;
+
+ if (mount_timeout_event) { // will be false if g_conf.num_client > 1.. see _try_mount above
+ timer.cancel_event(mount_timeout_event);
+ mount_timeout_event = 0;
+ }
mounted = true;
}
if (oldwhoami != whoami) {
// update messenger.
- messenger->reset_myname(MSG_ADDR_MDS(whoami));
-
reopen_logger();
dout(1) << "handle_mds_map i am now mds" << whoami
<< " incarnation " << mdsmap->get_inc(whoami)
if (mon->is_leader() &&
client_map.version > 1 &&
client_map.client_addr.empty() &&
- g_conf.mon_stop_on_last_unmount) {
+ g_conf.mon_stop_on_last_unmount &&
+ !mon->is_stopping()) {
dout(1) << "last client unmounted" << dendl;
mon->do_stop();
}
const static int STATE_LEADER = 1;
const static int STATE_PEON = 2;
int state;
+ bool stopping;
public:
bool is_starting() { return state == STATE_STARTING; }
bool is_leader() { return state == STATE_LEADER; }
bool is_peon() { return state == STATE_PEON; }
+ bool is_stopping() { return stopping; }
// -- elector --
timer(lock), tick_timer(0),
store(0),
- state(STATE_STARTING),
+ state(STATE_STARTING), stopping(false),
elector(this, w),
mon_epoch(0),
entity = rank.local[m->get_dest()];
} else {
entity = rank.find_unnamed(m->get_dest());
- if (!entity) {
+ if (entity) {
+ dout(3) << "pipe(" << peer_addr << ' ' << this << ").reader blessing " << m->get_dest() << dendl;
+ entity->reset_myname(m->get_dest());
+ } else {
if (rank.stopped.count(m->get_dest())) {
// ignore it
} else {
}
rank.lock.Unlock();
- if (entity)
+ if (entity)
entity->queue_message(m); // queue
}