Beispiel #1
0
        /// <summary>
        /// Notify the node that a pip execution completes.
        /// </summary>
        /// <param name="pipCompletionData">The pip completion data</param>
        public void NotifyPipCompletion(PipCompletionData pipCompletionData)
        {
            Contract.Requires(pipCompletionData != null);

            var pipId = new PipId(pipCompletionData.PipIdValue);

            // We might receive two notifications for the completion so that's why, we do not fail if there is no pipCompletionTask for the given pipId.
            PipCompletionTask pipCompletionTask;

            if (m_pipCompletionTasks.TryGetValue(pipId, out pipCompletionTask))
            {
                var reportedStep = (PipExecutionStep)pipCompletionData.Step;
                if (reportedStep != pipCompletionTask.RunnablePip.Step)
                {
                    // Step does not match the current step of the pip
                    // This can happen in the case of RPC retries for completion notification
                    return;
                }

                var pip = pipCompletionTask.Pip;
                var operationContext = pipCompletionTask.OperationContext;
                pipCompletionTask.SetDuration(pipCompletionData.ExecuteStepTicks, pipCompletionData.QueueTicks);

                var description = pipCompletionTask.RunnablePip.Description;
                int dataSize    = pipCompletionData.ResultBlob != null ? (int)pipCompletionData.ResultBlob.Count : 0;
                m_masterService.Environment.Counters.AddToCounter(pip.PipType == PipType.Process ? PipExecutorCounter.ProcessExecutionResultSize : PipExecutorCounter.IpcExecutionResultSize, dataSize);

                ExecutionResult result = m_masterService.ResultSerializer.DeserializeFromBlob(
                    pipCompletionData.ResultBlob,
                    WorkerId);

                pipCompletionTask.Set(result);
            }
        }
 /// <nodoc/>
 public ExtendedPipCompletionData(PipCompletionData pipCompletionData)
 {
     SerializedData = pipCompletionData;
 }