Skip to content

Commit b736784

Browse files
committed
explicit error message when moving to ERROOR state, in case not reported by control
1 parent f0f8f6a commit b736784

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/mainReadout.cxx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ class Readout
210210
int latencyFd = -1; // file descriptor for the "deep sleep" disabled
211211

212212
bool isError = 0; // flag set to 1 when error has been detected
213+
bool logFirstError = 0; // flag set to 1 after 1 error reported from iterateCheck/iterateRunning procedures
213214
std::vector<std::string> strErrors; // errors backlog
214215
std::mutex mutexErrors; // mutex to guard access to error variables
215216

@@ -1318,6 +1319,10 @@ int Readout::iterateCheck()
13181319
}
13191320
}
13201321
if (isError) {
1322+
if (!logFirstError) {
1323+
theLog.log(LogErrorSupport_(3231), "Error reported to state machine");
1324+
logFirstError = 1;
1325+
}
13211326
return -1;
13221327
}
13231328
if ((cfgMaxMsgError > 0) && (theLog.getMessageCount(InfoLogger::Severity::Error) >= (unsigned long) cfgMaxMsgError)) {
@@ -1343,6 +1348,10 @@ int Readout::iterateRunning()
13431348
return 1;
13441349
}
13451350
if (isError) {
1351+
if (!logFirstError) {
1352+
theLog.log(LogErrorSupport_(3231), "Error reported to state machine");
1353+
logFirstError = 1;
1354+
}
13461355
return -1;
13471356
}
13481357
// regular logbook stats update
@@ -1462,6 +1471,10 @@ int Readout::reset()
14621471
gReadoutStats.counters.notify++;
14631472
gReadoutStats.publishNow();
14641473

1474+
// reset error flags
1475+
isError = 0;
1476+
logFirstError = 0 ;
1477+
14651478
// close consumers before closing readout equipments (owner of data blocks)
14661479
theLog.log(LogInfoDevel, "Releasing primary consumers");
14671480
for (unsigned int i = 0; i < dataConsumers.size(); i++) {

0 commit comments

Comments
 (0)