Skip to content
Permalink
Browse files

[WFCORE-3185] Run parallel boot tasks in coarser grained chunks

  • Loading branch information
bstansberry committed May 19, 2017
1 parent 208356d commit 248564a09d7a6cd7f4e4e8526f18472ff1788cc0
@@ -334,7 +334,10 @@ public void start(final StartContext context) throws StartException {
rootResourceRegistration,
new ContainerStateMonitor(container, getStabilityMonitor()),
configurationPersister, processType, runningModeControl, prepareStep,
processState, executorService, expressionResolver, authorizer, securityIdentitySupplier, auditLogger, notificationSupport,
processState, executorService,
getMaxParallelBootExtensionTasks(),
getMaxParallelBootSubsystemTasks(),
expressionResolver, authorizer, securityIdentitySupplier, auditLogger, notificationSupport,
bootErrorCollector, createExtraValidationStepHandler(), capabilityRegistry, getPartialModelIndicator(),
injectedInstabilityListener.getOptionalValue());

@@ -395,6 +398,14 @@ public ServiceTarget getServiceTarget() {
bootThread.start();
}

protected int getMaxParallelBootExtensionTasks() {
return 1;
}

protected int getMaxParallelBootSubsystemTasks() {
return 1;
}

/**
* Gets whether this controller service should install a {@link ModelControllerClientFactory}
* and a {@link org.jboss.as.controller.notification.NotificationHandlerRegistry}
@@ -125,6 +125,8 @@
private final OperationStepHandler prepareStep;
private final ControlledProcessState processState;
private final ExecutorService executorService;
private final int maxParallelBootExtensionTasks;
private final int maxParallelBootSubsystemTasks;
private final ExpressionResolver expressionResolver;
private final Authorizer authorizer;
private final Supplier<SecurityIdentity> securityIdentitySupplier;
@@ -153,6 +155,8 @@
final ContainerStateMonitor stateMonitor, final ConfigurationPersister persister,
final ProcessType processType, final RunningModeControl runningModeControl,
final OperationStepHandler prepareStep, final ControlledProcessState processState, final ExecutorService executorService,
final int maxParallelBootExtensionTasks,
final int maxParallelBootSubsystemTasks,
final ExpressionResolver expressionResolver, final Authorizer authorizer, final Supplier<SecurityIdentity> securityIdentitySupplier,
final ManagedAuditLogger auditLogger, NotificationSupport notificationSupport,
final BootErrorCollector bootErrorCollector, final OperationStepHandler extraValidationStepHandler,
@@ -186,6 +190,8 @@
this.processState = processState;
this.serviceTarget.addMonitor(stateMonitor.getStabilityMonitor());
this.executorService = executorService;
this.maxParallelBootExtensionTasks = maxParallelBootExtensionTasks;
this.maxParallelBootSubsystemTasks = maxParallelBootSubsystemTasks;
assert expressionResolver != null;
this.expressionResolver = expressionResolver;
assert securityIdentitySupplier != null;
@@ -600,9 +606,10 @@ private BootOperations organizeBootOperations(List<ModelNode> bootList, final in
final ManagementResourceRegistration rootRegistration = managementModel.get().getRootResourceRegistration();
final MutableRootResourceRegistrationProvider parallellBRRRProvider = parallelBootRootResourceRegistrationProvider != null ?
parallelBootRootResourceRegistrationProvider : getMutableRootResourceRegistrationProvider();
ParallelExtensionAddHandler parallelExtensionAddHandler = executorService == null ? null : new ParallelExtensionAddHandler(executorService, parallellBRRRProvider);
ParallelBootOperationStepHandler parallelSubsystemHandler = (executorService != null && processType.isServer() && runningModeControl.getRunningMode() == RunningMode.NORMAL)
? new ParallelBootOperationStepHandler(executorService, rootRegistration, processState, this, lockPermit, extraValidationStepHandler) : null;
ParallelExtensionAddHandler parallelExtensionAddHandler = executorService == null || maxParallelBootExtensionTasks < 2 ? null : new ParallelExtensionAddHandler(executorService, maxParallelBootExtensionTasks, parallellBRRRProvider);
ParallelBootOperationStepHandler parallelSubsystemHandler = (executorService != null && maxParallelBootSubsystemTasks > 1 && processType.isServer() && runningModeControl.getRunningMode() == RunningMode.NORMAL)
? new ParallelBootOperationStepHandler(executorService, maxParallelBootSubsystemTasks, rootRegistration, processState, this, lockPermit, extraValidationStepHandler)
: null;
boolean registeredParallelSubsystemHandler = false;
int subsystemIndex = 0;
for (ModelNode bootOp : bootList) {

0 comments on commit 248564a

Please sign in to comment.
You can’t perform that action at this time.