none
ConnectFailure (Connection timed out) RRS feed

  • Question

  • I've written a client in c# which uses EWS Managed API to communicate with Exchange Server.

    After couple of hours of run, it starts giving weird issues. The response time of API calls starts going up i.e the API which takes <10 secs - afterwards takes > 1min.

    Randomly I see connect issues in my logs;

    Error: The request failed. Error: ConnectFailure (Connection timed out),   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.BuildEwsHttpWebRequest () [0x00000] in <filename unknown>:0
      at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest (IEwsHttpWebRequest& request) [0x00000] in <filename unknown>:0
      at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.InternalExecute () [0x00000] in <filename unknown>:0
      at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1[Microsoft.Exchange.WebServices.Data.ServiceResponse].Execute () [0x00000] in <filename unknown>:0
      at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalCreateItems (IEnumerable`1 items, Microsoft.Exchange.WebServices.Data.FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode, ServiceErrorHandling errorHandling)
     [0x00000] in <filename unknown>:0
      at Microsoft.Exchange.WebServices.Data.ExchangeService.CreateItem (Microsoft.Exchange.WebServices.Data.Item item, Microsoft.Exchange.WebServices.Data.FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode) [0x00000] in
     <filename unknown>:0
      at Microsoft.Exchange.WebServices.Data.Item.InternalCreate (Microsoft.Exchange.WebServices.Data.FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode) [0x00000] in <filename unknown>:0
      at Microsoft.Exchange.WebServices.Data.Appointment.Save (WellKnownFolderName destinationFolderName, SendInvitationsMode sendInvitationsMode) [0x00000] in <filename unknown>:0
      at ...
    
    



    vin14976@hotmail.com TechCenter Forums


    • Edited by Vin14976 Monday, May 23, 2016 4:21 AM
    Monday, May 23, 2016 4:21 AM

All replies

  • A timeout indicates a connectivity issue between the client and server rather then a Server issue (eg poor client connectivity), it maybe the server is too busy at that time to service your request. eg the behaviour your explaining could relate to packet loss (eg dropping a few packets) which slows the link but still allows some communication as TCP/IP can cope with this somewhat. Generally this then leads to the connection dropping and restabilising which relates to the timeout. 

    You need to look at what happening to the connection at the time you experience the issue eg if you have two different connection on two different clients to two different mailboxes do both connections get affected  at the same time? do some performance monitoring on the CAS server (eg is it suffering an issue at that time), check the EWS Log on the cas server at the time you have the problem.

    Cheers
    Glen

    Tuesday, May 24, 2016 4:13 AM
  • Hi,

    Thanks for your quick inputs.

    I'll analyze as you suggested. But certain things not yet clear to me..

    The default timeout in EWS is 100 sec. So, why this is happening continuously.

    Initial tests shows no problems, but after several hours of run, why performance degrades, & afterwards these connectivity issues?

    Vinay


    vin14976@hotmail.com TechCenter Forums

    Tuesday, May 24, 2016 5:51 AM
  • >>The default timeout in EWS is 100 sec. So, why this is happening continuously

    That is just the timeout for the client object your using to access EWS its not a server setting eg you can adjust you client timeout (service.timeout) to make it longer under the covers the EWS Managed API is just using httpwebrequest and that's the default timeout for httpwebrequest so this is client not server. The only timeout on the server side would be the Fast Search Timeout which is throttle setting and would only occur if your doing AQS search (if it throttling the EWSLog will indicate this). 

    >>Initial tests shows no problems, but after several hours of run, why performance degrades, & afterwards these connectivity issues?

    This is why you need to do the analysis otherwise it just speculation (eg Virtualization, third party software malfunctioning etc.) and you need to know what it happening at the time the problem is occurring (eg Perfmon on the CAS Server), is it normal no so it points to problems with your environment or clients.

    Cheers
    Glen

    Tuesday, May 24, 2016 6:13 AM