Buggy code:
public class DomainSlaveHandler implements OperationStepHandler { private final DomainOperationContext domainOperationContext ; private final Map < String , ProxyController > hostProxies ; public DomainSlaveHandler ( final Map < String , ProxyController > hostProxies , final DomainOperationContext domainOperationContext ) { } @ Override public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { if ( context . hasFailureDescription ( ) ) { context . setRollbackOnly ( ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> return ; } final Set < String > outstanding = new HashSet < String > ( hostProxies . keySet ( ) ) ; final List < TransactionalProtocolClient . PreparedOperation < HostControllerUpdateTask . ProxyOperation > > results = new java . util . ArrayList < TransactionalProtocolClient . PreparedOperation < HostControllerUpdateTask . ProxyOperation > > ( ) ; final Map < String , HostControllerUpdateTask . ExecutedHostRequest > finalResults = new HashMap < String , HostControllerUpdateTask . ExecutedHostRequest > ( ) ; final HostControllerUpdateTask . ProxyOperationListener listener = new HostControllerUpdateTask . ProxyOperationListener ( ) ; for ( Map . Entry < String , ProxyController > entry : hostProxies . entrySet ( ) ) { final String host = entry . getKey ( ) ; final TransformingProxyController proxyController = ( ( TransformingProxyController ) ( entry . getValue ( ) ) ) ; List < DomainOperationTransformer > transformers = context . getAttachment ( SLAVE_SERVER_OPERATION_TRANSFORMERS ) ; ModelNode op = operation ; if ( transformers != null ) { for ( final DomainOperationTransformer transformer : transformers ) { op = transformer . transform ( context , op ) ; } } final HostControllerUpdateTask task = new HostControllerUpdateTask ( host , op . clone ( ) , context , proxyController ) ; final HostControllerUpdateTask . ExecutedHostRequest finalResult = task . execute ( listener ) ; domainOperationContext . recordHostRequest ( host , finalResult ) ; finalResults . put ( host , finalResult ) ; } boolean interrupted = false ; try { try { while ( ( outstanding . size ( ) ) > 0 ) { final TransactionalProtocolClient . PreparedOperation < HostControllerUpdateTask . ProxyOperation > prepared = listener . retrievePreparedOperation ( ) ; final String hostName = prepared . getOperation ( ) . getName ( ) ; if ( ! ( outstanding . remove ( hostName ) ) ) { continue ; } final ModelNode preparedResult = prepared . getPreparedResult ( ) ; if ( DomainControllerLogger . HOST_CONTROLLER_LOGGER . isTraceEnabled ( ) ) { DomainControllerLogger . HOST_CONTROLLER_LOGGER . tracef ( "Preliminary<seq2seq4repair_space>result<seq2seq4repair_space>for<seq2seq4repair_space>remote<seq2seq4repair_space>host<seq2seq4repair_space>%s<seq2seq4repair_space>is<seq2seq4repair_space>%s" , hostName , preparedResult ) ; } final HostControllerUpdateTask . ExecutedHostRequest request = finalResults . get ( hostName ) ; boolean reject = ( prepared . isFailed ( ) ) ? false : request . rejectOperation ( preparedResult ) ; if ( reject ) { if ( DomainControllerLogger . HOST_CONTROLLER_LOGGER . isDebugEnabled ( ) ) { DomainControllerLogger . HOST_CONTROLLER_LOGGER . debugf ( "Rejecting<seq2seq4repair_space>result<seq2seq4repair_space>for<seq2seq4repair_space>remote<seq2seq4repair_space>host<seq2seq4repair_space>%s<seq2seq4repair_space>is<seq2seq4repair_space>%s" , hostName , preparedResult ) ; } final ModelNode failedResult = new ModelNode ( ) ; failedResult . get ( OUTCOME ) . set ( FAILED ) ; failedResult . get ( FAILURE_DESCRIPTION ) . set ( request . getFailureDescription ( ) ) ; domainOperationContext . addHostControllerResult ( hostName , failedResult ) ; results . add ( prepared ) ; } else { domainOperationContext . addHostControllerResult ( hostName , preparedResult ) ; results . add ( prepared ) ; } } } catch ( InterruptedException ie ) { interrupted = true ; domainOperationContext . setFailureReported ( true ) ; for ( final HostControllerUpdateTask . ExecutedHostRequest finalResult : finalResults . values ( ) ) { finalResult . asyncCancel ( ) ; } for ( final Map . Entry < String , HostControllerUpdateTask . ExecutedHostRequest > entry : finalResults . entrySet ( ) ) { final String hostName = entry . getKey ( ) ; try { final HostControllerUpdateTask . ExecutedHostRequest request = entry . getValue ( ) ; final ModelNode result = request . getFinalResult ( ) . get ( ) ; final ModelNode transformedResult = request . transformResult ( result ) ; domainOperationContext . addHostControllerResult ( hostName , transformedResult ) ; } catch ( Exception e ) { final ModelNode result = new ModelNode ( ) ; result . get ( OUTCOME ) . set ( FAILED ) ; if ( e instanceof InterruptedException ) { result . get ( FAILURE_DESCRIPTION ) . set ( DomainControllerMessages . MESSAGES . interruptedAwaitingResultFromHost ( entry . getKey ( ) ) ) ; interrupted = true ; } else { result . get ( FAILURE_DESCRIPTION ) . set ( DomainControllerMessages . MESSAGES . exceptionAwaitingResultFromHost ( entry . getKey ( ) , e . getMessage ( ) ) ) ; } domainOperationContext . addHostControllerResult ( hostName , result ) ; } } } context . completeStep ( ) ; } finally { try { boolean rollback = domainOperationContext . isCompleteRollback ( ) ; for ( final TransactionalProtocolClient . PreparedOperation < HostControllerUpdateTask . ProxyOperation > prepared : results ) { if ( prepared . isDone ( ) ) { continue ; } if ( ! rollback ) { prepared . commit ( ) ; } else { prepared . rollback ( ) ; } } for ( final TransactionalProtocolClient . PreparedOperation < HostControllerUpdateTask . ProxyOperation > prepared : results ) { final String hostName = prepared . getOperation ( ) . getName ( ) ; try { final HostControllerUpdateTask . ExecutedHostRequest request = finalResults . get ( hostName ) ; final ModelNode finalResult = prepared . getFinalResult ( ) . get ( ) ; final ModelNode transformedResult = request . transformResult ( finalResult ) ; domainOperationContext . addHostControllerResult ( hostName , transformedResult ) ; if ( DomainControllerLogger . HOST_CONTROLLER_LOGGER . isTraceEnabled ( ) ) { DomainControllerLogger . HOST_CONTROLLER_LOGGER . tracef ( "Final<seq2seq4repair_space>result<seq2seq4repair_space>for<seq2seq4repair_space>remote<seq2seq4repair_space>host<seq2seq4repair_space>%s<seq2seq4repair_space>is<seq2seq4repair_space>%s" , hostName , finalResult ) ; } } catch ( InterruptedException e ) { interrupted = true ; DomainControllerLogger . CONTROLLER_LOGGER . interruptedAwaitingFinalResponse ( hostName ) ; }

Fix:
context . stepCompleted ( ) ;