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:
Edison Su 2012-01-20 17:04:17 -08:00
parent 58d310a0e7
commit b4d14931f1
3 changed files with 10 additions and 1 deletions

View File

@ -607,6 +607,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());
}

View File

@ -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;
}
}

View File

@ -84,6 +84,7 @@ public class KVMFencer implements FenceBuilder {
List<HostVO> hosts = _hostDao.listByCluster(host.getClusterId());
FenceCommand fence = new FenceCommand(vm, host);
fence.setSeq(true);
for (HostVO h : hosts) {
if (h.getHypervisorType() == HypervisorType.KVM) {