Skip to content

Commit d9b8a6c

Browse files
comments
1 parent d751ca5 commit d9b8a6c

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.util.HashMap;
2828
import java.util.List;
2929
import java.util.Map;
30+
import java.util.Objects;
3031
import java.util.Set;
3132
import java.util.concurrent.ConcurrentHashMap;
3233
import java.util.concurrent.ExecutorService;
@@ -1045,11 +1046,11 @@ protected boolean handleDisconnectWithoutInvestigation(final AgentAttache attach
10451046
GlobalLock joinLock = getHostJoinLock(hostId);
10461047
try {
10471048
if (!joinLock.lock(60)) {
1048-
logger.debug("Unable to acquire lock on host {} to process agent disconnection", host != null? host : hostId);
1049+
logger.debug("Unable to acquire lock on host {} to process agent disconnection", Objects.toString(host, String.valueOf(hostId)));
10491050
return result;
10501051
}
10511052

1052-
logger.debug("Acquired lock on host {}, to process agent disconnection", host != null? host : hostId);
1053+
logger.debug("Acquired lock on host {}, to process agent disconnection", Objects.toString(host, String.valueOf(hostId)));
10531054
disconnectHostAgent(attache, event, host, transitState, joinLock);
10541055
result = true;
10551056
} finally {
@@ -1080,9 +1081,7 @@ private void disconnectHostAgent(final AgentAttache attache, final Status.Event
10801081
disconnectAgent(host, event, _nodeId);
10811082
}
10821083
} finally {
1083-
if (joinLock != null) {
1084-
joinLock.unlock();
1085-
}
1084+
joinLock.unlock();
10861085
}
10871086
}
10881087

@@ -1403,9 +1402,7 @@ private AgentAttache connectHostAgent(HostVO host, ReadyCommand ready, Link link
14031402
attache = createAttacheForConnect(host, link);
14041403
attache = notifyMonitorsOfConnection(attache, startupCmds, false);
14051404
} finally {
1406-
if (joinLock != null) {
1407-
joinLock.unlock();
1408-
}
1405+
joinLock.unlock();
14091406
}
14101407

14111408
return attache;

0 commit comments

Comments
 (0)