Ejemplo n.º 1
0
        internal static unsafe NodeTransitionProgress FromNative(IntPtr pointer)
        {
            NativeTypes.FABRIC_NODE_TRANSITION_PROGRESS nativeProgress = *(NativeTypes.FABRIC_NODE_TRANSITION_PROGRESS *)pointer;
            var state = TestCommandStateHelper.FromNative(nativeProgress.State);
            NodeCommandResult result = null;

            if (nativeProgress.Result != IntPtr.Zero)
            {
                result = new NodeCommandResult();
                result.CreateFromNative(nativeProgress.Result);
            }

            return(new NodeTransitionProgress(state, result));
        }
        public async Task <NodeTransitionProgress> GetNodeTransitionProgressAsync(
            Guid operationId,
            TimeSpan timeout,
            CancellationToken cancellationToken)
        {
            this.ThrowIfNotReady();
            NodeTransitionProgress progress = null;

            try
            {
                TestabilityTrace.TraceSource.WriteInfo(TraceType, "GetNodeTransitionProgressAsync got operation id {0}", operationId);
                ActionStateBase actionState = await this.MessageProcessor.ProcessGetProgressAsync(operationId, timeout, cancellationToken);

                StepStateNames           stateName = actionState.StateProgress.Peek();
                TestCommandProgressState state     = FaultAnalysisServiceUtility.ConvertState(actionState, TraceType);

                TestabilityTrace.TraceSource.WriteInfo(TraceType, "{0} - GetNodeTransitionProgressAsync reading nodecommandstate", operationId);
                NodeCommandState nodeState = actionState as NodeCommandState;
                TestabilityTrace.TraceSource.WriteInfo(TraceType, "{0} NodeCommandState is null={1}", operationId, nodeState == null);

                TestabilityTrace.TraceSource.WriteInfo(TraceType, "{0} - GetNodeTransitionProgressAsync node name={1}, node instance id={2}", operationId, nodeState.Info.NodeName, nodeState.Info.InputNodeInstanceId);
                NodeResult        nodeResult = new NodeResult(nodeState.Info.NodeName, nodeState.Info.InputNodeInstanceId);
                NodeCommandResult result     = new NodeCommandResult(nodeResult, actionState.ErrorCausingRollback);

                progress = new NodeTransitionProgress(state, result);
            }
            catch (Exception e)
            {
                TestabilityTrace.TraceSource.WriteWarning(TraceType, "{0} - Caught {1}", operationId, e.ToString());
                FaultAnalysisServiceUtility.ThrowTransientExceptionIfRetryable(e);

                throw;
            }

            return(progress);
        }
Ejemplo n.º 3
0
 internal NodeTransitionProgress(TestCommandProgressState state, NodeCommandResult result)
 {
     this.State  = state;
     this.Result = result;
 }