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?