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

Fixed heartbeat and object store GC timeout.

Added a deadline for hearbeat update (60s and 30s respectively) and bumped up garbage collection deadline to 90s.
parent 9c05e00e
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ cta::objectstore::Agent::Agent(const std::string & name, Backend & os):
void cta::objectstore::Agent::initialize() {
ObjectOps<serializers::Agent, serializers::Agent_t>::initialize();
m_payload.set_heartbeat(0);
m_payload.set_timeout_us(60*1000*1000);
m_payload.set_timeout_us(90*1000*1000);
m_payload.set_description("");
m_payload.set_being_garbage_collected(false);
m_payloadInterpreted = true;
......
......@@ -46,10 +46,9 @@ void AgentHeartbeatThread::run() {
utils::Timer t;
m_agentReference.bumpHeatbeat(m_backend);
auto updateTime = t.secs();
auto updateTimeLimit = std::chrono::duration<double, std::ratio<1, 1>>(m_heartRate).count();
if (updateTime > updateTimeLimit) {
if (updateTime > std::chrono::duration_cast<std::chrono::seconds>(m_heartbeatDeadline).count()) {
log::ScopedParamContainer params(lc);
params.add("HeartbeatUpdateTimeLimit", updateTimeLimit)
params.add("HeartbeatDeadline", std::chrono::duration_cast<std::chrono::seconds>(m_heartbeatDeadline).count())
.add("HeartbeatUpdateTime", updateTime);
lc.log(log::CRIT, "In AgentHeartbeatThread::run(): Could not update heartbeat in time. Exiting (segfault).");
cta::utils::segfault();
......
......@@ -66,6 +66,9 @@ private:
/// The heartbeat update rate.
std::chrono::seconds const m_heartRate = std::chrono::seconds(30);
/// The heartbeat update deadline.
std::chrono::seconds const m_heartbeatDeadline = std::chrono::seconds(60);
/// The logging context
log::Logger & m_logger;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment