6

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:

  • The timeout occurs between serviceA and serviceB, not between serviceB and the UI console, because I actually have two separate UI consoles: one is an MMC snap-in and one is a PowerShell snap-in, and both exhibit the same 10-minute timeout.

  • My endpoints in both serviceA and serviceB use basicHttpBinding; both have bindingConfigurations that specify sendTimeout and receiveTimeout at 30 minutes, not 10 minutes.

  • ReliableSession.InactivityTimeout defaults to 10 minutes I have read, but I do not believe either of these is a ReliableSession so it does not apply.

  • I instrumented serviceB for WCF tracing; ServiceTraceViewer showed the appropriate activity up to the start of the long-running service call, then nothing after that up to and including the 10-minute timeout.

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)

Michael Sorens
  • 35,361
  • 26
  • 116
  • 172
  • did you also try to play with open and close timeouts? – evgenyl Apr 03 '13 at 08:53
  • Both openTimeout and closeTimeout were both set to 1 minute so they would not be the culprits; what I have read about those parameters seems to support this fact as well. – Michael Sorens Apr 03 '13 at 17:49
  • I'm glad you fixed your problem, but this question is not generally useful. Nobody else could read the code where the problem was, and the problem wasn't described enough to ever help other people struggling with how timeouts work. – TamaMcGlinn Nov 09 '18 at 10:06

2 Answers2

1

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.

Michael Sorens
  • 35,361
  • 26
  • 116
  • 172
0

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)

Community
  • 1
  • 1
evgenyl
  • 7,837
  • 2
  • 27
  • 32
  • Thanks for the suggestions. I did manage to find the OperationTimeout and confirmed it was set to 30 minutes, as expected (since, per your source, it is set from the SendTimeout) so that does not seem to be the issue. – Michael Sorens Apr 04 '13 at 15:44