Michael Sorens
Michael Sorens

Reputation: 36708

WCF timeout not being honored

I am new to a project that extensively uses WCF and my experience with WCF is not extensive. I am trying to track down an issue where my UI presents a timeout error after 10 minutes while waiting for a long-running service call to return. Very roughly here is what my project entails:

[service A] <=> [service B] <=> [UI console]

And here is what I have gleaned thusfar:

Feel free to challenge me on any of my assertions and/or let me know what else I can do to diagnose this issue.

2013.04.04 Update

Here is the actual error message:

The request channel timed out while waiting for a reply after 00:09:59.9839984. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.

Server stack trace: at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at NextIT.ActiveAdministration.DataContracts.IActiveAdministration.PublishAgentSettings() at ...

And the inner exception:

The HTTP request to 'http://localhost/MyAdminService/' has exceeded the allotted timeout of 00:10:00. The time allotted to this operation may have been a portion of a longer timeout.

at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)

Upvotes: 6

Views: 4078

Answers (2)

Michael Sorens
Michael Sorens

Reputation: 36708

There is an old adage "If it does not work, try plugging it in." I was so focused on wending my way through the harrowing twists and turns of the app.config file rife with conflagration and fraught with confusion--partly because there are actually 5 app.config files with a variety of bindings and services in this large project(!)--that I failed to notice the obvious part where the code was overriding the config file:

binding.ReceiveTimeout = new TimeSpan(0, 0, 10, 0);
binding.SendTimeout = new TimeSpan(0, 0, 10, 0);

Sigh.

But wait--there's more. I was initially scratching my head over why the 30 minute value from the config file had no effect because the timeout occurred at 10 minutes? Well, it turns out that the 10-minute timeout—set in code as shown above—was from UI console to serviceB. The 30-minute timeout—set in the config file—was from the serviceB to serviceA, so I had to open up both wider to let a long-running operation proceed.

Upvotes: 1

evgenyl
evgenyl

Reputation: 8107

Try to play with operation timeout, as described here: http://final-proj.blogspot.co.il/2009/09/wcf-timeouts.html?m=1

Also, such configuration of services can cause a timeout, like working with callbacks. . . (from this post Timeouts WCF Services)

Upvotes: 0

Related Questions