Skip to content

Commit 1a719af

Browse files
committed
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
1 parent 69f239a commit 1a719af

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
@@ -405,6 +405,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
405405
ScheduledExecutorService _checkExecutor;
406406
ScheduledExecutorService _networkStatsUpdateExecutor;
407407
ExecutorService _rvrStatusUpdateExecutor;
408+
ExecutorService _rebootRouterExecutor;
408409

409410
BlockingQueue<Long> _vrUpdateQueue = null;
410411

@@ -571,6 +572,7 @@ public boolean configure(final String name, final Map<String, Object> params) th
571572
_executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("RouterMonitor"));
572573
_checkExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("RouterStatusMonitor"));
573574
_networkStatsUpdateExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("NetworkStatsUpdater"));
575+
_rebootRouterExecutor = Executors.newCachedThreadPool(new NamedThreadFactory("RebootRouterTask"));
574576

575577
VirtualMachine.State.getStateMachine().registerListener(this);
576578

@@ -2632,7 +2634,7 @@ public boolean postStateTransitionEvent(final StateMachine2.Transition<State, Vi
26322634
// 2. If VM is in running state in CS and there is a 'PowerOn' report from new host
26332635
if (hostId == null || hostId.longValue() != powerHostId.longValue()) {
26342636
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");
2635-
_executor.schedule(new RebootTask(vo.getId()), 1000, TimeUnit.MICROSECONDS);
2637+
_rebootRouterExecutor.execute(new RebootTask(vo.getId()));
26362638
}
26372639
}
26382640
}

0 commit comments

Comments
 (0)