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

Fixed error condition when polling a gone agent.

parent 1b867565
Branches
Tags
No related merge requests found
...@@ -31,7 +31,14 @@ public: ...@@ -31,7 +31,14 @@ public:
} }
bool checkAlive() { bool checkAlive() {
uint64_t newHeartBeatCount = readHeartbeat(); uint64_t newHeartBeatCount;
try {
newHeartBeatCount = readHeartbeat();
} catch (Backend::NoSuchObject &) {
// The agent could be gone. This is not an error. Mark it as alive,
// and will be trimmed later.
return true;
}
auto timer = m_timer.secs(); auto timer = m_timer.secs();
if (newHeartBeatCount == m_heartbeatCounter && timer > m_timeout) if (newHeartBeatCount == m_heartbeatCounter && timer > m_timeout)
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment