Skip to content

Commit

Permalink
[WFCORE-1989] Clone op before transforming it
Browse files Browse the repository at this point in the history
  • Loading branch information
bstansberry committed Nov 15, 2016
1 parent 808e341 commit 526c33a
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,20 @@ public void execute(final OperationContext context, final ModelNode operation) t
final Map<String, HostControllerUpdateTask.ExecutedHostRequest> finalResults = new HashMap<String, HostControllerUpdateTask.ExecutedHostRequest>();
final HostControllerUpdateTask.ProxyOperationListener listener = new HostControllerUpdateTask.ProxyOperationListener();
final Transformers.TransformationInputs transformationInputs = Transformers.TransformationInputs.getOrCreate(context);
final List<DomainOperationTransformer> transformers = context.getAttachment(OperationAttachments.SLAVE_SERVER_OPERATION_TRANSFORMERS);
for (Map.Entry<String, ProxyController> entry : hostProxies.entrySet()) {
// Create the proxy task
final String host = entry.getKey();
final TransformingProxyController proxyController = (TransformingProxyController) entry.getValue();
List<DomainOperationTransformer> transformers = context.getAttachment(OperationAttachments.SLAVE_SERVER_OPERATION_TRANSFORMERS);
ModelNode op = operation;
ModelNode clonedOp = operation.clone();
if (transformers != null) {
for (final DomainOperationTransformer transformer : transformers) {
op = transformer.transform(context, op);
// Set the flag for host controller operations
op.get(OPERATION_HEADERS, EXECUTE_FOR_COORDINATOR).set(true);
clonedOp = transformer.transform(context, clonedOp);
}
}

ModelNode clonedOp = op.clone();
// Set the flags for host controller operations
clonedOp.get(OPERATION_HEADERS, EXECUTE_FOR_COORDINATOR).set(true);
clonedOp.get(OPERATION_HEADERS, DomainControllerLockIdUtils.DOMAIN_CONTROLLER_LOCK_ID).set(CurrentOperationIdHolder.getCurrentOperationID());
final HostControllerUpdateTask task = new HostControllerUpdateTask(host, clonedOp, context, proxyController, transformationInputs);
// Execute the operation on the remote host
Expand Down

0 comments on commit 526c33a

Please sign in to comment.