我们遇到了 WCF 问题,需要很长时间才能诊断出来,所以我将它们发布在这里,以防有人遇到类似问题(在其他任何地方都没有找到参考资料)。
我们的流程经常会因以下未处理的异常而崩溃:
System.NullReferenceException: Object reference not set to an instance of an object.
at System.ServiceModel.Channels.OverlappedContext.CompleteCallback(UInt32 error, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Threading.Overlapped.Free(NativeOverlapped* nativeOverlappedPtr)
at System.ServiceModel.Channels.OverlappedContext.Free()
at System.ServiceModel.Channels.OverlappedContext.FreeOrDefer()
at System.ServiceModel.Channels.SocketConnection.Abort(TraceEventType traceEventType, String timeoutErrorString, TransferOperation transferOperation)
at System.ServiceModel.Channels.CommunicationPool`2.EndpointConnectionPool.CloseIdleConnection(TItem connection, TimeSpan timeout)
at System.ServiceModel.Channels.IdlingCommunicationPool`2.IdleTimeoutEndpointConnectionPool.IdleTimeoutIdleConnectionPool.OnIdle()
at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Threading.Overlapped.Free(NativeOverlapped* nativeOverlappedPtr)
at System.Net.AsyncRequestContext.Dispose(Boolean disposing)
at System.Net.RequestContextBase.Finalize()
异常通常在启动过程后几个小时发生,有时在几分钟后发生。
奇怪的是,它们只会在安装 2013 年 1 月的 Windows 更新后出现(并在卸载后消失)。