Пример #1
0
        public void Cancel(Exception e)
        {
            Logging.Error("Cancelling execution of graph {0}, due to exception:\n{1}", this.Index, e);

            lock (this)
            {
                if (this.currentState == InternalComputationState.Failed)
                {
                    return;
                }

                this.currentState = InternalComputationState.Failed;
                this.Exception    = e;


                if (this.Controller.NetworkChannel != null)
                {
                    MessageHeader  header  = MessageHeader.GraphFailure(this.index);
                    SendBufferPage page    = SendBufferPage.CreateSpecialPage(header, 0);
                    BufferSegment  segment = page.Consume();

                    Logging.Error("Broadcasting graph failure message");

                    this.Controller.NetworkChannel.BroadcastBufferSegment(header, segment);
                }

                this.ProgressTracker.Cancel();
            }
        }