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
This commit is contained in:
Koushik Das 2015-04-29 12:29:21 +05:30
parent 69f239afff
commit 1a719afb51
1 changed files with 3 additions and 1 deletions

View File

@ -405,6 +405,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
ScheduledExecutorService _checkExecutor;
ScheduledExecutorService _networkStatsUpdateExecutor;
ExecutorService _rvrStatusUpdateExecutor;
ExecutorService _rebootRouterExecutor;
BlockingQueue<Long> _vrUpdateQueue = null;
@ -571,6 +572,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
_executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("RouterMonitor"));
_checkExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("RouterStatusMonitor"));
_networkStatsUpdateExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("NetworkStatsUpdater"));
_rebootRouterExecutor = Executors.newCachedThreadPool(new NamedThreadFactory("RebootRouterTask"));
VirtualMachine.State.getStateMachine().registerListener(this);
@ -2632,7 +2634,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
// 2. If VM is in running state in CS and there is a 'PowerOn' report from new host
if (hostId == null || hostId.longValue() != powerHostId.longValue()) {
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");
_executor.schedule(new RebootTask(vo.getId()), 1000, TimeUnit.MICROSECONDS);
_rebootRouterExecutor.execute(new RebootTask(vo.getId()));
}
}
}