/// <summary> /// Report communication failure and update internal state /// </summary> private void ReportNodeCommunicationFailure ( int nodeIndex, Exception innerException, bool decreaseActiveNodeCount ) { // Indicate that communication with a particular node has failed if (nodeIndex >= 0 && nodeIndex < nodeData.Length) { if (decreaseActiveNodeCount && !nodeData[nodeIndex].CommunicationFailed) { DecreaseActiveNodeCount(nodeData[nodeIndex].NodeId); } nodeData[nodeIndex].CommunicationFailed = true; } string message = ResourceUtilities.FormatResourceString("NodeProviderFailure"); RemoteErrorException wrappedException = new RemoteErrorException(message, innerException, null); NodeStatus nodeStatus = new NodeStatus(wrappedException); if (nodeIndex < 0 || nodeIndex >= nodeData.Length) { // Bogus node index came out of the wait handle, perhaps due to memory pressure // We can't really do anything except re-throw so this problem can be diagnosed. throw wrappedException; } engineCallback.PostStatus(nodeData[nodeIndex].NodeId, nodeStatus, false); }