1

I have my WCF service in which one line of code is problematic - 1 in ~50 requests, this line of code is executing without end and when that happens, WCF service is hanging until it timeouts. Since it has:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,
                 ConcurrencyMode = ConcurrencyMode.Single)]

every other request to this WCF is getting:

"An error occurred while receiving the HTTP response to xxx. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down)."

for couple of minutes since the service is hanging. Is there a way to control how long the execution of WCF method is taking and abort it, if it takes too long?

8
  • Does the operation in question have a return or is it a void? May 20, 2016 at 9:07
  • It's a void method May 20, 2016 at 9:14
  • You could change the time out, but if you never get a response then the application will hang for a long period of time. It is better to use a sniffer like fiddler to attempt to find real root cause of issue.
    – jdweng
    May 20, 2016 at 9:17
  • The issue is that the line of code I'm using is from third party library, which has unmanaged code. That's why wcf hangs. I can't set timeouts, since the requests to the service are queued. May 20, 2016 at 9:27
  • And can I assume that the reason the service is a singleton is that you have a requirement for ordered delivery/processing? May 20, 2016 at 9:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.