}
trim_cache(true);
+
+ if (blacklisted && mounted &&
+ last_auto_reconnect + 30 * 60 < now &&
+ cct->_conf.get_val<bool>("client_reconnect_stale")) {
+ messenger->client_reset();
+ blacklisted = false;
+ _kick_stale_sessions();
+ last_auto_reconnect = now;
+ }
}
void Client::renew_caps()
case MetaSession::STATE_OPEN:
{
objecter->maybe_request_map(); /* to check if we are blacklisted */
- const auto& conf = cct->_conf;
- if (conf->client_reconnect_stale) {
+ if (cct->_conf.get_val<bool>("client_reconnect_stale")) {
ldout(cct, 1) << "reset from mds we were open; close mds session for reconnect" << dendl;
_closed_mds_session(s);
} else {
ceph::unordered_map<inodeno_t,SnapRealm*> snap_realms;
std::map<std::string, std::string> metadata;
+ utime_t last_auto_reconnect;
+
// trace generation
ofstream traceout;
OPTION(client_readahead_min, OPT_LONGLONG) // readahead at _least_ this much.
OPTION(client_readahead_max_bytes, OPT_LONGLONG) // default unlimited
OPTION(client_readahead_max_periods, OPT_LONGLONG) // as multiple of file layout period (object size * num stripes)
-OPTION(client_reconnect_stale, OPT_BOOL) // automatically reconnect stale session
OPTION(client_snapdir, OPT_STR)
OPTION(client_mount_uid, OPT_INT)
OPTION(client_mount_gid, OPT_INT)