Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

Commit

Permalink
Add host id to agent reconnect error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Jellick committed May 25, 2018
1 parent 8416b5c commit ae7d5d5
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.cattle.platform.agent.server.ping.impl;

import static io.cattle.platform.core.model.tables.HostTable.*;
import static com.google.common.util.concurrent.Futures.*;

import io.cattle.platform.agent.AgentLocator;
Expand All @@ -13,6 +14,7 @@
import io.cattle.platform.core.constants.AgentConstants;
import io.cattle.platform.core.constants.CommonStatesConstants;
import io.cattle.platform.core.model.Agent;
import io.cattle.platform.core.model.Host;
import io.cattle.platform.engine.process.ExitReason;
import io.cattle.platform.engine.process.ProcessInstanceException;
import io.cattle.platform.engine.process.util.ProcessEngineUtils;
Expand Down Expand Up @@ -90,7 +92,6 @@ protected void handleOwned(Agent agent) {
if (isInterval(PING_INSTANCES_EVERY.get())) {
ping.setOption(Ping.INSTANCES, true);
}

doPing(agent, ping);
}

Expand Down Expand Up @@ -141,7 +142,12 @@ protected void pingFailure(Agent agent) {
try {
agent = objectManager.reload(agent);
if (CommonStatesConstants.ACTIVE.equals(agent.getState())) {
log.error("Scheduling reconnect for [{}]", agent.getId());
Host host = objectManager.findAny(Host.class, HOST.AGENT_ID, agent.getId());
if (host != null) {
log.error("Scheduling reconnect for agent [{}] host [{}] count [{}]", agent.getId(), host.getId(), count);
} else {
log.error("Scheduling reconnect for agent [{}] count [{}]", agent.getId(), count);
}
processManager.scheduleProcessInstance(AgentConstants.PROCESS_RECONNECT, agent, null);
}
} catch (ProcessInstanceException e) {
Expand Down

0 comments on commit ae7d5d5

Please sign in to comment.