Skip to content
Snippets Groups Projects
Commit 8bf6587d authored by Eric Cano's avatar Eric Cano
Browse files

Replaced exit with SIGSEGV when process get slow in stress tests.

This will allow diagnosing slow-downs.
parent d0ea4041
Branches
Tags
No related merge requests found
......@@ -19,6 +19,9 @@
#include "AgentHeartbeatThread.hpp"
#include "common/log/LogContext.hpp"
#include "common/Timer.hpp"
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
namespace cta { namespace objectstore {
......@@ -47,7 +50,8 @@ void AgentHeartbeatThread::run() {
log::ScopedParamContainer params(lc);
params.add("HeartbeatUpdateTimeLimit", updateTimeLimit)
.add("HeartbeatUpdateTime", updateTime);
lc.log(log::CRIT, "In AgentHeartbeatThread::run(): Could not update heartbeat in time. Exiting.");
lc.log(log::CRIT, "In AgentHeartbeatThread::run(): Could not update heartbeat in time. Exiting (segfault).");
::kill(::getpid(), SIGSEGV);
::exit(EXIT_FAILURE);
}
}
......@@ -56,8 +60,9 @@ void AgentHeartbeatThread::run() {
} catch (cta::exception::Exception & ex) {
log::ScopedParamContainer params(lc);
params.add("Message", ex.getMessageValue());
lc.log(log::CRIT, "In AgentHeartbeatThread::run(): exception while bumping heartbeat. Backtrace follows. Exiting.");
lc.log(log::CRIT, "In AgentHeartbeatThread::run(): exception while bumping heartbeat. Backtrace follows. Exiting (segfault).");
lc.logBacktrace(log::ERR, ex.backtrace());
::kill(::getpid(), SIGSEGV);
::exit(EXIT_FAILURE);
}
}
......
......@@ -162,7 +162,8 @@ void AgentReference::queueAndExecuteAction(std::shared_ptr<Action> action, objec
if (ag.isBeingGarbageCollected()) {
log::ScopedParamContainer params(lc);
params.add("agentObject", ag.getAddressIfSet());
lc.log(log::CRIT, "In AgentReference::queueAndExecuteAction(): agent object being garbage collected. Exiting.");
lc.log(log::CRIT, "In AgentReference::queueAndExecuteAction(): agent object being garbage collected. Exiting (segfault).");
::kill(::getpid(), SIGSEGV);
::exit(EXIT_FAILURE);
}
double agentFetchTime = t.secs(utils::Timer::resetCounter);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment