FIX: First submitted message takes longer to process than expected after periods of inactivity when you use a BizTalk Server 2010 WCF-Custom adapter

Article ID: 2811803 - View products that this article applies to.
Expand all | Collapse all

On This Page

Symptoms

Assume that you try to use a BizTalk Server 2010 WCF-Custom adapter to send messages. You set the minimum value (1 second) for the SendTimeout property of the CustomBindingElement object. After some periods of inactivity, the first message submitted may take longer to process in a low-latency environment than expected. Additionally, you may receive an exception that resembles the following:

Description:
Error Message: SOAP Exception description : System.ServiceModel.CommunicationException: An error (The request was aborted: The request was canceled.) occurred while transmitting data over the HTTP channel. ---> System.Net.WebException: The request was aborted: The request was canceled.
at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStreamAsyncResult.CompleteGetRequestStream(IAsyncResult result)
--- End of inner exception stack trace ---

Server stack trace:
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)
Timestamp: 26/10/2012 13:59:50
Category: General
Priority: -1
EventId: 10081
Severity: Error
Title:
Machine: Machine Name
App Domain: __XDomain_3.0.1.0_0
ProcessId: 5684
Process Name: Installation Drive:\Program Files (x86)\Microsoft BizTalk Server 2010\BTSNTSvc64.exe
Thread Name:
Win32 ThreadId:11436


Cause

This issue occurs because the common language runtime (CLR) 4.0 begins an operation after 15 seconds that cleans up and terminates any idle IO completion ports until only one port remains. This operation occurs after periods of inactivity before you send messages by using the WCF-custom send port. After a longer period of inactivity, the CLR gate thread (which is partly responsible for creating new IO completion port threads) is also destroyed.

There is a certain way that BizTalk calls into WCF and configures a SendTimeout value in the HttpWebRequest object. To manage this, WCF will use this IO completion port thread to set up an IOThreadTimer class to set a timer that starts if the request is not completed within the time-out period. Then, the thread waits for the timer, and is blocked. However, WCF tries to send the message when it needs another IO completion port. When no IO completion port is available, the CLR must create one together with creating the gate thread. Because of an initial delay between the starting of the gate thread and the gate thread creating an IO completion port thread, the timer that is created by WCF triggers before the IO completion port thread can be created and then read the awaiting data from the socket to be sent.

Resolution

Cumulative update information

To resolve this issue, apply the following cumulative update package. This cumulative update package resolves the issue in the Microsoft.BizTalk.Adapter.Wcf.Runtime.dll component.

For BizTalk Server 2010

The hotfix that resolves this issue is included in cumulative update package 6 for BizTalk Server 2010.

For more information about how to obtain this cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:
2855367 Cumulative update package 6 for BizTalk Server 2010


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

More information

For more information about delays in IO thread creation, go to the following MSDN blog:

Why Does WCF Become Slow After Being Idle For 15 Seconds?

For information about the service packs and cumulative update list for BizTalk Server, click the following article number to view the article in the Microsoft Knowledge Base:
2555976 Service pack and cumulative update list for BizTalk Server
For more information about BizTalk hotfixes and Service Pack support, click the following article number to view the article in the Microsoft Knowledge Base:
2003907 Information about BizTalk hotfixes and Service Pack support

Properties

Article ID: 2811803 - Last Review: July 12, 2013 - Revision: 1.0
Applies to
  • Microsoft BizTalk Server Enterprise 2010
  • Microsoft BizTalk Server Branch 2010
  • Microsoft BizTalk Server Developer 2010
  • Microsoft BizTalk Server Standard 2010
Keywords: 
kbqfe kbfix kbsurveynew kbexpertiseadvanced KB2811803

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com