stephenV

I currently have an event driven service running at fairly high speeds (a new message every 30-40 ms) and the data is coming through perfectly, however I continue to get a:

System.ServiceModel.CommunicationObjectAbortedException

"The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it has been Aborted."

I'm slightly confused because the data continues to be received by the client, and the exception is intermittent, sometimes occurring once between message receives and other times occurring five times. The tests are all being run locally using wsDualHttpBindings, and netTcpBindings. I do not restart the service or the client at any time.

Can anyone shed some insight into the possible reasons behind this



Re: Windows Communication Foundation (Indigo) Strange CommunicationObjectAbortedException behaviour

TrevorW

Thats a lot of messages, and I certainly can guess:

Is it possible that you have a combination of settings such that a message is timing out, throwing a fault, yet you also have a reliable session such that it tries again. So, you are getting both the exception/fault and the benefit of reliable session where it simply retries and successfully gets through after the timeout It may be due to the high transaction volume, or particular messages that take longer, or some other delay that is introduced in the channel, or any combination.

... just a guess.

Trevor





Re: Windows Communication Foundation (Indigo) Strange CommunicationObjectAbortedException behaviour

stephenV

I thought that myself, so I disabled the reliable session, just to play with it. It doesn't seem to make a difference. Would sending messages too quickly cause the channel to be aborted Also, I've tried adding a delay in (just Thread.Sleep) for a half second to a second, and it reduces the frequency of the exception, but doesn't eliminate it. I'm not familiar enough with the model to know what would cause that specific exception.

The messages are extremely small but need to be delivered in real-time (hence the high frequency). Would another service binding be more appropriate than tcp





Re: Windows Communication Foundation (Indigo) Strange CommunicationObjectAbortedException behaviour

stephenV

I'm not sure if the exception from the Tracelog would help with this, but I'll post a section of it in the interest of too-much-information-is-better-than-too-little.

<Exception>
<ExceptionType>System.ServiceModel.CommunicationObjectAbortedException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it has been Aborted.</Message>
<StackTrace>
at System.ServiceModel.Channels.CommunicationObject.ThrowIfDisposedOrNotOpen()
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)





Re: Windows Communication Foundation (Indigo) Strange CommunicationObjectAbortedException behaviour

Brian McNamara - MSFT

So is this exception bubbling up to your client app

Are you using the client proxy on multiple threads

Who is aborting the channel Do you have client app code that closes the client and aborts if close() throws

Are you using the IsTerminating feature on OperationContract, perchance

Overall I feel like this smells like some bug in the logic of how the client app is interacting with the client/proxy, but I am unsure.






Re: Windows Communication Foundation (Indigo) Strange CommunicationObjectAbortedException behaviour

TrevorW

I thought I might add one more potential source (well, maybe) - regarding the 'using' statement and try/catch implementations

http://msdn2.microsoft.com/en-us/library/aa355056.aspx





Re: Windows Communication Foundation (Indigo) Strange CommunicationObjectAbortedException behaviour

stephenV

Thanks for the help, I fixed the problem. I was running a series of tests, and the service was being restarted between each test, with an appropriate wait period. It turns out, it wasn't entirely appropriate. Starting the service and running it for the duration of the tests illiminated the problem completely. Your question "Who is aborting the channel " lead me to delve into that one.

Thanks for the help.





Re: Windows Communication Foundation (Indigo) Strange CommunicationObjectAbortedException behaviour

stephenV

Thanks for the info on the using statements. It didn't help with the problem, but it wasn't something I knew before either, so I'll watch out for it.

Cheers