Commit 577ae069 authored by Mac Newbold's avatar Mac Newbold
Browse files

Fix a corner case: When the idleswap warning time the same as someone's

choice of idleswap times, it was sending the email before the expt had
even been idle for 5 minutes. So add a check to make sure that they're
idle at least idle_threshold minutes before we send warnings. Meaning, if
the swap time is 30 minutes, and the warning time is 30 minutes, you won't
get a warning at all, instead of warnings every time you've been idle for
1 minute (ie it has been a minute since the last node reported activity).
parent 64400c2c
......@@ -251,7 +251,8 @@ from node_activity as na left join reserved as r on na.node_id=r.node_id
left join experiments as e on and r.eid=e.eid
where swappable>0 and state="active" and idleswap>0 group by pid,eid
having idlemin+$idle_warnmin>=idleswap_timeout and
idlemin+$idle_warnmin<=idleswap_timeout+$window order by pid,eid
idlemin+$idle_warnmin<=idleswap_timeout+$window and
idlemin >= (60 * $threshold) order by pid,eid
$q = DBQueryFatal($sql);
if ($d) { print $sql,"\n",$q->as_string; $q->dataseek(0); }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment