mirror of https://github.com/apache/cloudstack.git
execute fencecommand in seq for kvm, as there are only 5 default nio reading work threads on kvm agent. pinganswer may not be got serviced immediately, then agent will reconnect to mgt server again and again
This commit is contained in:
parent
3f07346087
commit
ecab972060
|
|
@ -582,6 +582,8 @@ public class Agent implements HandlerFactory, IAgentControl {
|
|||
|
||||
try {
|
||||
task.getLink().send(request.toBytes());
|
||||
//if i can send pingcommand out, means the link is ok
|
||||
setLastPingResponseTime();
|
||||
} catch (final ClosedChannelException e) {
|
||||
s_logger.warn("Unable to send request: " + request.toString());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,12 +29,18 @@ public class FenceCommand extends Command {
|
|||
String vmName;
|
||||
String hostGuid;
|
||||
String hostIp;
|
||||
boolean inSeq;
|
||||
|
||||
public FenceCommand(VirtualMachine vm, Host host) {
|
||||
super();
|
||||
vmName = vm.getInstanceName();
|
||||
hostGuid = host.getGuid();
|
||||
hostIp = host.getPrivateIpAddress();
|
||||
inSeq = false;
|
||||
}
|
||||
|
||||
public void setSeq(boolean inseq) {
|
||||
inSeq = inseq;
|
||||
}
|
||||
|
||||
public String getVmName() {
|
||||
|
|
@ -51,6 +57,6 @@ public class FenceCommand extends Command {
|
|||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
return inSeq;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ public class KVMFencer implements FenceBuilder {
|
|||
|
||||
List<HostVO> hosts = _resourceMgr.listAllHostsInCluster(host.getClusterId());
|
||||
FenceCommand fence = new FenceCommand(vm, host);
|
||||
fence.setSeq(true);
|
||||
|
||||
for (HostVO h : hosts) {
|
||||
if (h.getHypervisorType() == HypervisorType.KVM) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue