Skip to content

Commit 795f381

Browse files
koushik-dasyadvr
authored andcommitted
CLOUDSTACK-8426: Use a separate thread pool for VR reboot in case of out-of-band movement
Using a cached thread pool for VR reboot task (cherry picked from commit 1a719af) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 6378d37 commit 795f381

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
435435
ScheduledExecutorService _checkExecutor;
436436
ScheduledExecutorService _networkStatsUpdateExecutor;
437437
ExecutorService _rvrStatusUpdateExecutor;
438+
ExecutorService _rebootRouterExecutor;
438439

439440
Account _systemAcct;
440441

@@ -688,6 +689,7 @@ public boolean configure(final String name, final Map<String, Object> params) th
688689
_executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("RouterMonitor"));
689690
_checkExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("RouterStatusMonitor"));
690691
_networkStatsUpdateExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("NetworkStatsUpdater"));
692+
_rebootRouterExecutor = Executors.newCachedThreadPool(new NamedThreadFactory("RebootRouterTask"));
691693

692694
VirtualMachine.State.getStateMachine().registerListener(this);
693695

@@ -4494,7 +4496,7 @@ public boolean postStateTransitionEvent(StateMachine2.Transition<State, VirtualM
44944496
// 2. If VM is in running state in CS and there is a 'PowerOn' report from new host
44954497
if (hostId == null || (hostId.longValue() != powerHostId.longValue())) {
44964498
s_logger.info("Schedule a router reboot task as router " + vo.getId() + " is powered-on out-of-band, need to reboot to refresh network rules");
4497-
_executor.schedule(new RebootTask(vo.getId()), 1000, TimeUnit.MICROSECONDS);
4499+
_rebootRouterExecutor.execute(new RebootTask(vo.getId()));
44984500
}
44994501
}
45004502
}

0 commit comments

Comments
 (0)