Uploaded image for project: 'Spring.NET'
  1. Spring.NET
  2. SPRNET-1550

Intermittent WCF failures when using WebSupportModule

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.3.0, 1.3.2
    • Fix Version/s: None
    • Component/s: Spring-NET-WEB
    • Labels:
      None
    • Environment:
      Windows Server 2003, IIS 6, .NET 4.0

      Description

      We have an application containing .aspx and .svc pages. Within that application the calls to the WCF services sometimes fail.
      The sometimes is of the order of less then 10 times a day and does not seem to be affected by the total number of calls.
      On several occasions we saw those calls fail every 40 minutes.

      We were not able to reproduce that issue in a sample application.

      We were not able to reproduce that issue on Windows Server 2008 R2.

      The failure is observed on the client side:
      For ajax calls (with integrated windows security) in IE (8) we have either a popup asking for windows credentials or the ajax calls fails with a statustext unknown.

      For external applications (using .NET) the calls failed with:
      <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error">
      <TraceIdentifier>http://msdn.microsoft.com/nl-BE/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier>
      <Description>Throwing an exception.</Description>
      <AppDomain>/LM/W3SVC/1/ROOT/???</AppDomain>
      <Exception>
      <ExceptionType>System.ServiceModel.CommunicationException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
      <Message>The underlying connection was closed: The connection was closed unexpectedly.</Message>
      <StackTrace>
      at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
      at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
      at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
      at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
      at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout)
      at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout)
      at System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout)
      at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout)
      at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
      at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
      at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
      at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
      at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
      at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
      at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
      at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
      at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
      at ...
      at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
      at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
      at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
      at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
      at System.Web.Services.Protocols.WebServiceHandler.Invoke()
      at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
      at System.Web.Services.Protocols.SyncSessionlessHandler.ProcessRequest(HttpContext context)
      at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
      at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
      at System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(Exception error)
      at System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
      at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
      at System.Web.HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
      at System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
      </StackTrace>
      <ExceptionString>System.ServiceModel.CommunicationException: The underlying connection was closed: The connection was closed unexpectedly. ---> System.Net.WebException: The underlying connection was closed: The connection was closed unexpectedly.
      at System.Net.HttpWebRequest.GetResponse()
      at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
      — End of inner exception stack trace ---</ExceptionString>
      <InnerException>
      <ExceptionType>System.Net.WebException, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
      <Message>The underlying connection was closed: The connection was closed unexpectedly.</Message>
      <StackTrace>
      at System.Net.HttpWebRequest.GetResponse()
      at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
      </StackTrace>
      <ExceptionString>System.Net.WebException: The underlying connection was closed: The connection was closed unexpectedly.
      at System.Net.HttpWebRequest.GetResponse()
      at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)</ExceptionString>
      </InnerException>
      </Exception>
      </TraceRecord>

      On the server side nothing was found in WCF traces, event logs and IIS logs. In the application traces (only when the failure occurs) we observed exactly 101 calls to Global.asax to BeginRequest and then 101 calls to Global.asax EndRequest.

      The accepted solution for us was to remove the WebSupportModule from the modules and get the objects we need from the context when needed.

      I'm mentioning this here as we've spend over 3 months actively into this issue before finding the culprit, and I would like to avoid anyone else going through this endeavours process.

        Attachments

          Activity

            People

            • Assignee:
              sbohlen Steve Bohlen
              Reporter:
              gibmaster Jérôme Malherbe
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: