Buggy code:
public class WebDeploymentDefinition extends SimpleResourceDefinition { public static final WebDeploymentDefinition INSTANCE = new WebDeploymentDefinition ( ) ; public static final AttributeDefinition CONTEXT_ROOT = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( "context-root" , ModelType . STRING ) . setStorageRuntime ( ) . build ( ) ; public static final AttributeDefinition VIRTUAL_HOST = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( "virtual-host" , ModelType . STRING ) . setStorageRuntime ( ) . build ( ) ; private WebDeploymentDefinition ( ) { } @ Override public void registerAttributes ( ManagementResourceRegistration resourceRegistration ) { } static class SessionManagerStatsHandler extends AbstractRuntimeOnlyHandler { static WebDeploymentDefinition . SessionManagerStatsHandler INSTANCE = new WebDeploymentDefinition . SessionManagerStatsHandler ( ) ; private SessionManagerStatsHandler ( ) { } public static WebDeploymentDefinition . SessionManagerStatsHandler getInstance ( ) { } @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { final PathAddress address = PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ; final Resource web = context . readResourceFromRoot ( address . subAddress ( 0 , address . size ( ) ) , false ) ; final ModelNode subModel = web . getModel ( ) ; final String host = WebDeploymentDefinition . VIRTUAL_HOST . resolveModelAttribute ( context , subModel ) . asString ( ) ; final String path = WebDeploymentDefinition . CONTEXT_ROOT . resolveModelAttribute ( context , subModel ) . asString ( ) ; final ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( WebSubsystemServices . deploymentServiceName ( host , path ) ) ; WebDeploymentDefinition . SessionStat stat = WebDeploymentDefinition . SessionStat . getStat ( operation . require ( NAME ) . asString ( ) ) ; if ( stat == null ) { context . getFailureDescription ( ) . set ( MESSAGES . unknownMetric ( operation . require ( NAME ) . asString ( ) ) ) ; } else { final Context webContext = Context . class . cast ( controller . getValue ( ) ) ; ManagerBase sm = ( ( ManagerBase ) ( webContext . getManager ( ) ) ) ; ModelNode result = new ModelNode ( ) ; switch ( stat ) { case ACTIVE_SESSIONS : result . set ( sm . getActiveSessions ( ) ) ; break ; case EXPIRED_SESSIONS : result . set ( sm . getExpiredSessions ( ) ) ; break ; case MAX_ACTIVE_SESSIONS : result . set ( sm . getMaxActive ( ) ) ; break ; case SESSIONS_CREATED : result . set ( sm . getSessionCounter ( ) ) ; break ; case DUPLICATED_SESSION_IDS : result . set ( sm . getDuplicates ( ) ) ; break ; case SESSION_AVG_ALIVE_TIME : result . set ( sm . getSessionAverageAliveTime ( ) ) ; break ; case SESSION_MAX_ALIVE_TIME : result . set ( sm . getSessionMaxAliveTime ( ) ) ; break ; case REJECTED_SESSIONS : result . set ( sm . getRejectedSessions ( ) ) ; break ; default : throw new IllegalStateException ( MESSAGES . unknownMetric ( stat ) ) ; } context . getResult ( ) . set ( result ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } } public enum SessionStat { ACTIVE_SESSIONS ( new org . jboss . as . controller . SimpleAttributeDefinition ( "active-sessions" , ModelType . INT , false ) ) , EXPIRED_SESSIONS ( new org . jboss . as . controller . SimpleAttributeDefinition ( "expired-sessions" , ModelType . INT , false ) ) , SESSIONS_CREATED ( new org . jboss . as . controller . SimpleAttributeDefinition ( "sessions-created" , ModelType . INT , false ) ) , DUPLICATED_SESSION_IDS ( new org . jboss . as . controller . SimpleAttributeDefinition ( "duplicated-session-ids" , ModelType . INT , false ) ) , SESSION_AVG_ALIVE_TIME ( new org . jboss . as . controller . SimpleAttributeDefinition ( "session-avg-alive-time" , ModelType . INT , false ) ) , SESSION_MAX_ALIVE_TIME ( new org . jboss . as . controller . SimpleAttributeDefinition ( "session-max-alive-time" , ModelType . INT , false ) ) , REJECTED_SESSIONS ( new org . jboss . as . controller . SimpleAttributeDefinition ( "rejected-sessions" , ModelType . INT , false ) ) , MAX_ACTIVE_SESSIONS ( new org . jboss . as . controller . SimpleAttributeDefinition ( "max-active-sessions" , ModelType . INT , false ) ) ; private static final Map < String , WebDeploymentDefinition . SessionStat > MAP = new HashMap < String , WebDeploymentDefinition . SessionStat > ( ) ; final AttributeDefinition definition ; private SessionStat ( final AttributeDefinition definition ) { } @ Override public final String toString ( ) { } public static synchronized WebDeploymentDefinition . SessionStat getStat ( final String stringForm ) { } } }

Fix:
context . stepCompleted ( ) ;