2011-03-18 3 views
1

충돌, 자기 호스팅 ServiceHosts의 수 (아래 예)WCF - 많은 많은 많은 첫 번째 예외가 발생되고이 - 그럼 내가 다른 것들 사이에있는 WPF 응용 프로그램 (호스트)가 앱

와 WCF를

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, 
ConcurrencyMode = ConcurrencyMode.Multiple, 
UseSynchronizationContext = false)] 
public class Data : HBase, IData 
:
host= new ServiceHost(typeof(Data)); 
ServiceEndpoint endpoint = _HostData.AddServiceEndpoint(typeof(IData), _tcpBindingBO, _netTcpAddress + "data"); 


// add throttle behaviour 
ServiceThrottlingBehavior throttle = host.Description.Behaviors.Find<ServiceThrottlingBehavior>(); 
if (throttle == null) 
{ 
    throttle = new ServiceThrottlingBehavior(); 

    throttle.MaxConcurrentCalls = _SymphonyHostProp.MaxConcurrentCalls;  // 200;   // default 16  // 64 
    throttle.MaxConcurrentInstances = _SymphonyHostProp.MaxConcurrentInstances; // 1000;  // default 26  // 464 
    throttle.MaxConcurrentSessions = _SymphonyHostProp.MaxConcurrentCalls;  // default 10  // 400 

    host.Description.Behaviors.Add(throttle); 
} 

// open the host - bring it into life! 
host.Open(); 

는 I는 '데이터'노출 된 개체는 다음과 같이 정의되고이

int MaxBuffer = 64;  // 64 Mb 
int bufferSize = MaxBuffer * 1024 * 1024; // 67108864    

// ----------------------------------------- 
// binding for normal clients (default) 
// ----------------------------------------- 
_tcpBinding = new NetTcpBinding(SecurityMode.None, true); 
_tcpBinding.MaxBufferPoolSize = bufferSize; // 64 Mb 
_tcpBinding.MaxBufferSize = bufferSize; 
_tcpBinding.MaxReceivedMessageSize = bufferSize; 
_tcpBinding.TransferMode = TransferMode.Buffered; 
_tcpBinding.ReaderQuotas.MaxArrayLength = bufferSize; 
_tcpBinding.ReaderQuotas.MaxBytesPerRead = bufferSize; 
_tcpBinding.ReaderQuotas.MaxStringContentLength = bufferSize; 
_tcpBinding.MaxConnections = 100; 
//_tcpBinding.ReceiveTimeout = new TimeSpan(0, 0, 5); 
_tcpBinding.SendTimeout = MyHost.SendTimeout; 
_tcpBinding.ReliableSession.Enabled = true; 
//tcpBinding.ReliableSession.InactivityTimeout = new TimeSpan(7, 0, 0, 0); // 7 days 

같이 nettcpbinding 사용이 호스트에 연결 클라이언트가

문제는 호스트의 정상적인 실행하는 동안 약 50 사용자가 수백 WCF 관련 오류의가 오는 보여주는 IDE에서 갑자기 출력 창을 모두 연결되어 있다는 것입니다. 그리고

나는 그것이 사라질 운 경우 몇 초 후에 그 자체만으로도이 시간 동안 전체 UI와 호스트 응용 프로그램의 모든 것이 멈추고 WCF는 더 이상 다른 사용자에게 서비스를 제공하지 않습니다. 그런 다음 다시 돌아 오면 다시 잘못 될 때까지는 문제가 없습니다.

여기에는 내부 네트워크 문제가없는 것 같습니다. 나는 추적을 가능하게했지만 그 안에 많은 유용한 정보를 찾을 수 없었다. 누구나이 문제가 발생했는지 궁금합니다.

필요한 경우 더 많은 정보를 제공해 드리겠습니다.

이러한 오류 중 1000 개는 출력 창에 생성됩니다.

A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll 
A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll 

답변

2

첫 번째 예외 오류가 없습니다. 이들은 일반적으로 잡히게 될 예외입니다. 당신은 그들을 무시해야합니다.

걱정할 예외는 잡히지 않는 예외입니다.

+0

를 부릅니다. 어떤 일이 일어나고 있는지 누군가가 밝힐 수 있습니까? – Marcel

+0

아무 것도 일어나지 않습니다. 이것들이 당신의 문제와 관련이 있다는 가정을하고 있습니다. 그들은 아마하지 않습니다. 당신은 소세지가 어떻게 만들어 졌는지 보려고 시작했고 당신은 그것을별로 좋아하지 않습니다. –

+0

만약 이것이 의미가 있다고 생각한다면 WCF 추적 기능을 켜고 무슨 일이 벌어지는 지에 대해 좀 더 자세히 설명해 줄 것을 권한다. 또한 피들러 (Fiddler) 등으로 네트워크를 살펴보십시오. –

1

최근에이 문제가 발생했습니다. 내 경우에는 사용자 지정 log4net WCF Appender를 사용하고 있었고 log4net 라이브러리는 디버그 창에 A first chance exception을 가져 오는 이유는 절대로 잡히지 않는 예외를 throw하지 않도록 설계되었습니다. 나는 log4net이하기 전에 예외를 가로 챌 수 있도록 호출을 시도하고 서비스 자체를 try 블록으로 랩핑해야만했다. 그리고 이것이 내가 진정한 원인을 찾을 수있게했다.

예외가 다른 문제에서 비롯된 것처럼 보이지만 해결책은 여전히 ​​동일합니다. 시도/catch를 가져와 전체 오류 세부 정보를 얻고 문제의 출처를 식별 할 수 있습니다.

Btw, 전체 응용 프로그램이 충돌하는 경우 매우 손쉬운 트릭을 사용하여 충돌이 발생하는 캐치되지 않은 예외를 얻을 수 있습니다. 응용 프로그램이 시작되면 간단하게, 최대한 빨리 이러한 오류가 (자신의 1000 년대에) 들어오는 시작하면 내가 호스트가 느려 UI를 정지 결국 때때로 충돌 한 빨리 그들을 무시하지만 수 있다는 사실을 알고

AppDomain.Current.UnhandledException += (sender, error) => File.AppendAllText("Fatal.log", error.ExceptionObject.ToString() + "\r\n");