mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
mds: set laggy flag if dispatch takes too long
This prevents, e.g., tick() from coming in immediately after and closing out client sessions after we chew through something particularly slow.
This commit is contained in:
parent
ea035fea80
commit
fdd5709afc
@ -1271,6 +1271,8 @@ bool MDS::_dispatch(Message *m)
|
||||
{
|
||||
bool check_from = false;
|
||||
|
||||
utime_t req_start = g_clock.now();
|
||||
|
||||
#define ALLOW_MESSAGES_FROM(peers) \
|
||||
do { \
|
||||
if (m->get_connection() && (m->get_connection()->get_peer_type() & (peers)) == 0) { \
|
||||
@ -1442,6 +1444,16 @@ do { \
|
||||
}
|
||||
}
|
||||
|
||||
utime_t duration = g_clock.now();
|
||||
duration -= req_start;
|
||||
if (duration > g_conf.mds_session_timeout / 2) {
|
||||
dout(0) << " dispatch took " << duration << " > " << g_conf.mds_tick_interval
|
||||
<< " seconds, setting laggy flag" << dendl;
|
||||
laggy = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// hack: thrash exports
|
||||
static utime_t start;
|
||||
utime_t now = g_clock.now();
|
||||
|
Loading…
Reference in New Issue
Block a user