views:

115

answers:

3

We have a .Net 3.5 Workflow hosted as a service that sometimes stops unexpectedly. This has occurred at times while it is writing a file and, most recently, when receiving a reply from another WCF service. There are no exceptions being caught, as these all get logged, and there are no messages in the event logs on the server where both are hosted. I added logging to verify that the service is completing it's logic, which it is (taking about 6 minutes). All my timeouts are far higher than they need be. I'm starting to think the issue might be that the channel is getting closed and, due to the very high timeouts, an error is not yet thrown. Of potential relevance, the workflow is calling the wcf service asynchronously and then using a WaitOne() on the AsyncWaitHandle. I have a feeling this is maybe not the best idea, but I'm not sure if it could cause this issue. Also, persistence is not set up on the workflow (I had previously thought that the unloadOnIdle setting might have been causing issues with getting return values from the called service, as I'm not very clear on how this is supposed to work).

Any help/advice would be greatly appreciated.

A: 

Have you checked the timeout settings on the client. I know in the past I had to update both the client timeout settings as well as the server settings.

Sean Barlow
See my comment below...
Brian
A: 

In the workflow App.config (missing a timeout for the hosting of the workflow?):

<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_IService" closeTimeout="00:02:00"
      openTimeout="00:02:00" receiveTimeout="04:00:00" sendTimeout="04:00:00"
      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
      maxBufferSize="655360000" maxBufferPoolSize="2147483647" maxReceivedMessageSize="655360000"
      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
      useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None"
          realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
<client>
  <endpoint address="http://url/Service.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
    contract="DALService.IService" name="BasicHttpBinding_IService" />
</client>

In the DalService WCF web.config:

<httpRuntime
    maxRequestLength="1048576"
    executionTimeout="6000000"
/>
<basicHttpBinding>
<binding name ="LargeMessageBinding"
          closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="04:30:00" sendTimeout="04:30:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="655360000" maxBufferPoolSize="524288" maxReceivedMessageSize="655360000"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true"
         />
<!--maxReceivedMessageSize="6553600" -->
<!--maxBufferSize="6553600" -->

Brian
A: 

Turns out, the workflow was not being hosted in its own worker process, as I had thought. Another app was crashing the process. The WCF service was correctly configured to use its own worker process, hence it would correctly return, but to a no longer running app.

Brian