server = new Server(this);
locker = new Locker(this, mdcache);
+ dispatch_depth = 0;
+
// clients
last_client_mdsmap_bcast = 0;
m->put();
ret = true;
} else {
+ inc_dispatch_depth();
ret = _dispatch(m);
+ dec_dispatch_depth();
}
mds_lock.Unlock();
return ret;
}
}
+ if (dispatch_depth > 1)
+ return true;
+
while (!waiting_for_nolaggy.empty()) {
// stop if we're laggy now!
}
private:
+ int dispatch_depth;
bool ms_dispatch(Message *m);
bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new);
bool ms_verify_authorizer(Connection *con, int peer_type,
void request_osdmap(Context *c);
+ void inc_dispatch_depth() { ++dispatch_depth; }
+ void dec_dispatch_depth() { --dispatch_depth; }
+
// messages
bool _dispatch(Message *m);
this->mds = mds;
}
virtual void finish(int r) {
+ mds->inc_dispatch_depth();
mds->_dispatch(m);
+ mds->dec_dispatch_depth();
}
};