none
Timeout setting issue with reliable session in wsHttp binding

    Question

  • We have created a wcf service with wsHttpBinding and reliable session enabled. On the wcf client side when the web service is not running, we get an EndpointNotFoundException. The issue i am facing is that if the reliable session is enabled the time taken to get the exception is governed by sendTimeout. But if the reliable session is disabled the time taken to get the exception is governed by openTimeout.

    Can somebody please explain me why the time taken to get the exception is governed by sendTimeout and not openTimeout in case the reliable session is enabled. And is there any way for me to make it depend upon openTimeout, i can only modify client side configuration and modifying server side configuration would not be possible?

    Also the time taken to get the exception when the reliable session is enabled is not exactly sendTimeout but a value less than that. In case sendTimeout is 30 seconds, it takes somewhere around 22 seconds to get the exception?


    Here are the relevant server side binding configuration and client side configuration.


    Server Configuration

          <bindings>
                <wsHttpBinding>
                  <binding name="WsHttpBindingForRemoteAccess"
                             maxReceivedMessageSize="9000000">
                    <readerQuotas
                      maxArrayLength="1000000"
                      maxStringContentLength="2000000"/>
                    <reliableSession enabled="true" inactivityTimeout="00:10:00" />
                  </binding>
                </wsHttpBinding>
            </bindings>

    Client side configuration

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <system.serviceModel>
            <bindings>
                <wsHttpBinding>
                  <binding name="Default_WsHttpBinding" maxReceivedMessageSize="9000000" openTimeout="00:00:02" sendTimeout="00:00:30">
                    <readerQuotas maxArrayLength="1000000" maxStringContentLength="2000000" />
                    <reliableSession enabled="true" inactivityTimeout="00:10:00" />
                  </binding>
                </wsHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://localhost:8001/service/plain" binding="wsHttpBinding"
                    bindingConfiguration="Default_WsHttpBinding" contract="IPingService"
                    name="WSHttpBinding_IPingService" />
            </client>
        </system.serviceModel>
    </configuration>

    Thanks in advance...
    Thursday, June 24, 2010 12:10 PM

Answers

  • Hi,

    I viewd your project and test the Service and Client. I change the configuration on the service side look below.

    I think its works

    <bindings>
            <wsHttpBinding>
              <binding name="WsHttpBindingForRemoteAccess" maxReceivedMessageSize="9000000">
                <readerQuotas maxStringContentLength="2000000" maxArrayLength="1000000" />
                <reliableSession inactivityTimeout="00:01:00" enabled="true" />
              </binding>
            </wsHttpBinding>
          </bindings>

     

    Wednesday, June 30, 2010 12:49 PM

All replies

  • Hi,

    Different timeouts have different meanings:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1385935&SiteID=1

    From your description it looks to me when reliable session is enabled it requires more time to open channel and your openTimeout is set to 2 seconds, which may not be enough to complete.

    As to:

    Also the time taken to get the exception when the reliable session is enabled is not exactly sendTimeout but a value less than that. In case sendTimeout is 30 seconds, it takes somewhere around 22 seconds to get the exception?

    I'm not quite sure. How do you get this conclusion? To answer this question, in my opinion, first we need to know the "22 seconds" is correctly calculated. Then we need to know the timeout is indeed caused by sendTimeout. Could you provide a demo that can reproduce this behavior? Please upload the project to http://skydrive.com and paste download link here for me to test.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. Windows Azure Platform China Blog: http://blogs.msdn.com/azchina/default.aspx
    Monday, June 28, 2010 4:11 AM
    Moderator
  • Hi Allen,

    Thanks for the reply. I had gone through the link you have mentioned and I studied the various timeout and from my understanding i thought the timeout should depend upon openTimeout instead of sendTimeout.

    I did change the openTimeout to a higher value, much higher value but still it was dependent more one sendTimeout.

    I have uploaded the test project at skydrive and here is the link, it is my skydrive.

    http://cid-fa0e831d8def7084.office.live.com/browse.aspx/Test%20Project?Bsrc=EMSHGM&Bpub=SN.Notifications

    You can simply get the Test.zip file and have a look at it. I have add a txt file to explain the steps to get to the problem. You can change the config settings and you will see that it depend upon sendTimeout and not openTimeout.

    Thanks again for looking into it.

    Tuesday, June 29, 2010 12:30 PM
  • Hi,

    Thanks for your project. I tested your project twice but got the same 30 seconds timeout. Is my understanding correct that to reproduce this issue I only need to open TestClient in Visual Studio, start debugging, wait and view the output in Console to see the 22 seconds timeout message?


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. Windows Azure Platform China Blog: http://blogs.msdn.com/azchina/default.aspx
    Wednesday, June 30, 2010 2:22 AM
    Moderator
  • Hi,

    Thanks for looking into the project. It sounds strange because i checked again and i am still getting the time required for timeout as 22 seconds. In the console first you will see a numeral and that is the time in seconds taken for timeout. An after that the description of the exception. You can wait for it to try the second time and see how much time it takes for the subsequent attempts. If you want i can send you the sceen shot of the output i am getting. Can there be any difference in the machine environment that might be the cause for this difference?

    Thanks again...

    Wednesday, June 30, 2010 11:38 AM
  • Hi,

    I viewd your project and test the Service and Client. I change the configuration on the service side look below.

    I think its works

    <bindings>
            <wsHttpBinding>
              <binding name="WsHttpBindingForRemoteAccess" maxReceivedMessageSize="9000000">
                <readerQuotas maxStringContentLength="2000000" maxArrayLength="1000000" />
                <reliableSession inactivityTimeout="00:01:00" enabled="true" />
              </binding>
            </wsHttpBinding>
          </bindings>

     

    Wednesday, June 30, 2010 12:49 PM