Revision 1bcfc2bd src/raft/RaftManager.cc
src/raft/RaftManager.cc | ||
---|---|---|
757 | 757 |
|
758 | 758 |
if ( rc == -1 ) |
759 | 759 |
{ |
760 |
std::ostringstream oss; |
|
760 |
static time_t last_error = 0; |
|
761 |
static int num_errors = 0; |
|
761 | 762 |
|
762 |
oss << "Error sending heartbeat to follower " << it->first <<": " |
|
763 |
<< error; |
|
763 |
num_errors++; |
|
764 | 764 |
|
765 |
NebulaLog::log("RCM", Log::INFO, oss); |
|
765 |
if ( last_error == 0 ) |
|
766 |
{ |
|
767 |
last_error = time(0); |
|
768 |
num_errors = 1; |
|
769 |
} |
|
770 |
else if ( last_error + 60 < time(0) ) |
|
771 |
{ |
|
772 |
if ( num_errors > 10 ) |
|
773 |
{ |
|
774 |
std::ostringstream oss; |
|
775 |
|
|
776 |
oss << "Detetected error condition on follower " |
|
777 |
<< it->first <<". Last error was: " << error; |
|
778 |
|
|
779 |
NebulaLog::log("RCM", Log::INFO, oss); |
|
780 |
} |
|
781 |
|
|
782 |
last_error = 0; |
|
783 |
} |
|
766 | 784 |
} |
767 | 785 |
else if ( success == false && fterm > term ) |
768 | 786 |
{ |
Also available in: Unified diff