Skip to content

Commit

Permalink
Merge branch 'develop' into 1510_stuck_detection_agent_monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
kladkogex committed Dec 12, 2023
2 parents 72c491a + 6b307ba commit 6cb64ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 4 additions & 4 deletions monitoring/StuckDetectionAgent.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2018-2019 SKALE Labs
Copyright (C) 2018- SKALE Labs
This file is part of skale-consensus.
Expand All @@ -16,9 +16,7 @@
You should have received a copy of the GNU Affero General Public License
along with skale-consensus. If not, see <https://www.gnu.org/licenses/>.
@file StuckDetectionAgent.cpp
@author Stan Kladko
@date 2021
*/

#include "Log.h"
Expand Down Expand Up @@ -75,6 +73,7 @@ void StuckDetectionAgent::StuckDetectionLoop(StuckDetectionAgent *_agent) {

if (numberOfPreviousRestarts > 0) {
LOG(info, "Stuck detection engine: previous restarts detected:" << numberOfPreviousRestarts);

}

uint64_t restartIteration = numberOfPreviousRestarts + 1;
Expand Down Expand Up @@ -197,6 +196,7 @@ uint64_t StuckDetectionAgent::doStuckCheck(uint64_t _restartIteration) {
auto lastCommittedBlockTimeStampS = getSchain()->getLastCommittedBlockTimeStamp().getS();

return lastCommittedBlockTimeStampS * 1000 + restartIntervalMs + 120000;

}

void StuckDetectionAgent::restart(uint64_t _restartTimeMs, uint64_t _iteration) {
Expand All @@ -207,7 +207,6 @@ void StuckDetectionAgent::restart(uint64_t _restartTimeMs, uint64_t _iteration)
usleep(100);
} catch (...) {
}

getNode()->exitCheck();
}

Expand All @@ -233,6 +232,7 @@ string StuckDetectionAgent::restartFileName(uint64_t _iteration) {

void StuckDetectionAgent::createStuckRestartFile(uint64_t _iteration) {
CHECK_STATE(_iteration >= 1);

auto fileName = restartFileName(_iteration);

ofstream f;
Expand Down
4 changes: 1 addition & 3 deletions monitoring/StuckDetectionAgent.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2018-2019 SKALE Labs
Copyright (C) 2018- SKALE Labs
This file is part of skale-consensus.
Expand All @@ -16,9 +16,7 @@
You should have received a copy of the GNU Affero General Public License
along with skale-consensus. If not, see <https://www.gnu.org/licenses/>.
@file StuckDetectionAgent.h
@author Stan Kladko
@date 2020
*/

#pragma once
Expand Down

0 comments on commit 6cb64ed

Please sign in to comment.