5

I have a WorkflowServiceHost I am starting in a Windows Service. Everything is working fine but after a while the service stops responding to requests. Looking through the trace logs I can see an exception being thrown - in this case by a simple load of the metadata page - regarding the communication object being aborted:

The communication object, System.ServiceModel.Channels.TransportReplyChannelAcceptor+TransportReplyChannel, cannot be used for communication because it has been Aborted.

There are no previous logs in the trace file that indicate problems. We monitor it every minute to ensure it's running (because this problem occurs) and I can see many successful requests on the metadata page before it suddenly begins reporting it's in an aborted state.

At this point the only way to recover is to restart my service. I've used WCF many times before but never as the frontend to WF. I've never had this problem with my WCF services before so could something be happening with the WorkflowServiceHost?

Thanks!

UPDATE:

Here are some of the trace logs from WCF:

enter image description here

Matthew Bonig
  • 2,001
  • 2
  • 20
  • 40
  • It can be due to by FireWall or Proxy server. – Musketyr Feb 27 '14 at 06:57
  • Why would it work fine for hours and then stop? – Matthew Bonig Feb 27 '14 at 13:20
  • What type of InstanceContextMode do you have? I have the similar problem, if was not for a long time no request to the server, then connection is aborted. I put Ping from client to server to maintan connection. – Musketyr Feb 27 '14 at 14:00
  • Oddly enough we have a ping setup against it for every minute to monitor it's state, so I don't know I'd call it "inactive". – Matthew Bonig Feb 27 '14 at 21:29
  • Are you sure that error is not in WCF methods? Try to call only one or two simple method and wait if WCF stop working after 4 hours. Are you using some security mode? Put the WCF config, please. – Musketyr Feb 28 '14 at 05:51
  • I'm sure it isn't hitting my WCF service implementation, just the metadata request. See the screenshot I just added. – Matthew Bonig Feb 28 '14 at 18:51
  • isn´t it the thing you are looking for? http://stackoverflow.com/questions/2008382/how-to-heal-faulted-wcf-channels – Yaugen Vlasau Mar 06 '14 at 20:56
  • Nope, I'm afraid not. Again, this is not a fault on a client proxy object, this is a channel fault on the server. It most often occurs while doing a simple HTTP GET on the metadata page. Once it faults the entire WCF ServiceHost has to be destroyed and recreated. – Matthew Bonig Mar 06 '14 at 21:13
  • A few questions - Anything in the IIS logs? Do you have all Windows updates? Have you tried rebooting this server (sometimes odd behaviour just goes away after a reboot). Have you tried on a different server - is it recreatable? If so is the issue specific to a particular OS and IIS version? Is the problem related to an unhandled exception? (which you can test with a test service that just throws an exception each time). – redcalx Mar 12 '14 at 10:18
  • 1
    A channel becomes faulted when an unhandled exception is thrown, my guess is you have a specific workflow activity that results in an exception and you don't properly recreate your proxy. This could even be a timeout from the service, the key is whatever is originating the request needs to new proxy. – Chris Marisic Mar 12 '14 at 16:55
  • @Locster, yes, have tried rebooting, nothing in IIS logs because IIS is not being used, it's a Windows Service. This happens in a few different environments. There is nothing happening with service method calls when the failure occurs, it happens when a HTTP GET on the metadata page. – Matthew Bonig Mar 12 '14 at 19:09

1 Answers1

0

add this if you don't have it. an exception will fault the channel unless you abort (or restart your service) What is the best workaround for the WCF client `using` block issue?

catch (Exception e)
{
    ...
    client.Abort();
    throw;
}
Community
  • 1
  • 1
Joe
  • 1,649
  • 12
  • 10
  • this isn't on the client side... it's a server side issue. – Matthew Bonig Mar 05 '14 at 19:36
  • right.....if channel fault on server side from exception then you should abort your client proxy – Joe Mar 12 '14 at 17:56
  • I agree. However, there is no client proxy. This failure is occurring when a simple HTTP GET request of the metadata and then continues to fail until the entire service is shutdown and restarted. – Matthew Bonig Mar 12 '14 at 19:07
  • maybe hitting Service Throttle then..... http://blogs.msdn.com/b/distributedservices/archive/2010/03/31/wcf-service-hung-how-to-debug-servicethrottle.aspx – Joe Mar 12 '14 at 19:32
  • 1
    If throttling causes an exception and kills the service then I'm ditching WCF and MS tech all together and becoming a mechanic. – Matthew Bonig Mar 12 '14 at 19:48