OPTION(mon_osd_cache_size, OPT_INT, 10) // the size of osdmaps cache, not to rely on underlying store's cache
OPTION(mon_tick_interval, OPT_INT, 5)
+OPTION(mon_session_timeout, OPT_INT, 300) // must send keepalive or subscribe
OPTION(mon_subscribe_interval, OPT_DOUBLE, 300)
OPTION(mon_delta_reset_interval, OPT_DOUBLE, 10) // seconds of inactivity before we reset the pg delta to 0
OPTION(mon_osd_laggy_halflife, OPT_INT, 60*60) // (seconds) how quickly our laggy estimations decay
}
assert(s);
+
+ s->session_timeout = ceph_clock_now(NULL);
+ s->session_timeout += g_conf->mon_session_timeout;
+
if (s->auth_handler) {
s->entity_name = s->auth_handler->get_entity_name();
}
// don't trim monitors
if (s->inst.name.is_mon())
- continue;
+ continue;
- if (!s->until.is_zero() && s->until < now) {
+ if (s->session_timeout < now && s->con) {
+ // check keepalive, too
+ s->session_timeout = s->con->get_last_keepalive();
+ s->session_timeout += g_conf->mon_session_timeout;
+ }
+ if (s->session_timeout < now) {
dout(10) << " trimming session " << s->con << " " << s->inst
- << " (until " << s->until << " < now " << now << ")" << dendl;
+ << " (timeout " << s->session_timeout
+ << " < now " << now << ")" << dendl;
} else if (out_for_too_long) {
// boot the client Session because we've taken too long getting back in
dout(10) << " trimming session " << s->con << " " << s->inst
struct MonSession : public RefCountedObject {
ConnectionRef con;
entity_inst_t inst;
+ utime_t session_timeout;
utime_t until;
utime_t time_established;
bool closed;