From 4c05dd74154e696a16613c2c8fb9343159ba8280 Mon Sep 17 00:00:00 2001 From: coderfengyun Date: Mon, 1 Sep 2014 09:09:30 +0800 Subject: [PATCH] refactor refactor --- .../highavailable/impl/HighAvailablePoolImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/infrastructure/highavailable/impl/HighAvailablePoolImpl.java b/Bench4Q-Master/src/main/java/org/bench4q/master/infrastructure/highavailable/impl/HighAvailablePoolImpl.java index 3fec4818..6416dd6e 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/infrastructure/highavailable/impl/HighAvailablePoolImpl.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/infrastructure/highavailable/impl/HighAvailablePoolImpl.java @@ -265,13 +265,11 @@ public class HighAvailablePoolImpl extends CurrentLoadSubject implements if (allocationFinish(load)) { break; } - if (this.queryAgentStatus(agent) == null || agent.isInUse() - || agent.getRemainLoad() != agent.getMaxLoad()) { + if (agent.isInUse()) { continue; } loadForRunCurrent = getMin(load, agent.getRemainLoad()); agent.bookTest(loadForRunCurrent); - this.getAgentRepository().update(agent); runScenarioResultModel = this.getAgentMessenger().bookTest(agent, loadForRunCurrent); if (runScenarioResultModel == null @@ -279,6 +277,7 @@ public class HighAvailablePoolImpl extends CurrentLoadSubject implements logger.error(runScenarioResultModel == null ? "runScenarioResultModel is null" : "runScenarioResultModel.getRunId()" + runScenarioResultModel.getRunId()); + agent.backLoad(loadForRunCurrent); continue; } load -= loadForRunCurrent; @@ -289,6 +288,7 @@ public class HighAvailablePoolImpl extends CurrentLoadSubject implements runScenarioResultModel.getRunId()); result.add(runningAgentWithouRunningScript); this.addABlotter(runningAgentWithouRunningScript); + this.getAgentRepository().update(agent); } if (!allocationFinish(load)) { logger.error("allocationUnfinished, remain " + load