Remove failure reports that are too old, where too old means reasonably * older than the global node timeout. Note that anyway for a node to be * flagged as FAIL we need to have a local PFAIL state that is at least * older than the global node timeout, so we don't just trust the number * of failure reports from other nodes. */
| 891 | * older than the global node timeout, so we don't just trust the number |
| 892 | * of failure reports from other nodes. */ |
| 893 | void clusterNodeCleanupFailureReports(clusterNode *node) { |
| 894 | list *l = node->fail_reports; |
| 895 | listNode *ln; |
| 896 | listIter li; |
| 897 | clusterNodeFailReport *fr; |
| 898 | mstime_t maxtime = g_pserver->cluster_node_timeout * |
| 899 | CLUSTER_FAIL_REPORT_VALIDITY_MULT; |
| 900 | mstime_t now = mstime(); |
| 901 | |
| 902 | listRewind(l,&li); |
| 903 | while ((ln = listNext(&li)) != NULL) { |
| 904 | fr = (clusterNodeFailReport*)ln->value; |
| 905 | if (now - fr->time > maxtime) listDelNode(l,ln); |
| 906 | } |
| 907 | } |
| 908 | |
| 909 | /* Remove the failing report for 'node' if it was previously considered |
| 910 | * failing by 'sender'. This function is called when a node informs us via |
no test coverage detected