Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wcf warnings and error

Tags:

c#

.net

wcf

I am trying to debug why my WCF service seems to randomly hang under high load. I added some trace and got the warings and errors below:

warning: PipeConnetion aborted
warning: Failed to open System.ServiceModel.Channels.ServerSessionPreambleConnectionReader+ServerFramingDuplexSessionChannel
warning: Faulted System.ServiceModel.Channels.ServerSessionPreambleConnectionReader+ServerFramingDuplexSessionChannel
warning: An incoming channel was disposed because there was an error while attempting to open it.
error: System.IO.PipeException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
There was an error writing to the pipe: The pipe is being closed. (232, 0xe8).

the stacktrace for the error is:

System.ServiceModel.Channels.PipeConnection.WriteHelper(Byte[] buffer, Int32 offset,         Int32 size, Boolean immediate, TimeSpan timeout, Object& holder)
System.ServiceModel.Channels.PipeConnection.Write(Byte[] buffer, Int32 offset, Int32   size, Boolean immediate, TimeSpan timeout)
System.ServiceModel.Channels.BufferedConnection.WriteNow(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, BufferManager bufferManager)
System.ServiceModel.Channels.BufferedConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
System.ServiceModel.Channels.ServerSessionPreambleConnectionReader.ServerFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
System.ServiceModel.Dispatcher.ChannelHandler.OpenAndEnsurePump()
System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

I cannot find any information related to these errors. Anybody have an idea or some pointers as to where I should start looking?

edit: This service is hosted within a Windows service, and is a InstanceContextMode.Single. The client making these calls creates and disposes of the proxy after each call.

like image 824
Mike_G Avatar asked Mar 26 '26 05:03

Mike_G


1 Answers

Try increasing the ReceiveTimeout in the BindingConfiguration for the Service in Web.Config.

receiveTimeout="00:30:00"

Maximum is receiveTimeout="infinite" but I certainly don't recommend that ;)

You could also try changing the InstanceContextMode to PerCall in the ServiceBehavior Decoration in the class where you have defined your Service.

InstanceContextMode = InstanceContextMode.PerCall
like image 150
Shiva Avatar answered Mar 28 '26 19:03

Shiva



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!