服务总线导致w3wp崩溃

时间:2016-12-05 16:36:10

标签: azure azureservicebus

我们的网络应用使用Azure Service Bus来传达任何缓存更改。启动时,它会订阅一个主题,如果它收到一条消息,它将使缓存无效。我们的应用程序处理优雅的服务总线有时会出现超时问题。但是,在极少数情况下,我们的网络应用程序完全崩溃。我们将错误追溯到以下内容:

Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
   at System.Web.Hosting.UnsafeIISMethods.MgdGetSiteNameFromId(IntPtr, UInt32, IntPtr ByRef, Int32 ByRef)
   at System.Web.Configuration.ProcessHostConfigUtils.GetSiteNameFromId(UInt32)
   at System.Web.Configuration.ProcessHostMapPath.MapPathCaching(System.String, System.Web.VirtualPath)
   at System.Web.Configuration.ProcessHostMapPath.System.Web.Configuration.IConfigMapPath2.MapPath(System.String, System.Web.VirtualPath)
   at System.Web.Configuration.WebConfigurationHost.IsConfigRecordRequired(System.String)
   at System.Configuration.BaseConfigurationRecord.hlNeedsChildFor(System.String)
   at System.Configuration.Internal.InternalConfigRoot.GetConfigRecord(System.String)
   at System.Configuration.Internal.InternalConfigRoot.GetUniqueConfigRecord(System.String)
   at System.Web.Configuration.HttpConfigurationSystem.GetUniqueConfigRecord(System.String)
   at System.Web.CachedPathData.Init(System.Web.CachedPathData)
   at System.Web.CachedPathData.GetConfigPathData(System.String)
   at System.Web.Configuration.HttpConfigurationSystem.GetApplicationSection(System.String)
   at System.Configuration.ConfigurationManager.GetSection(System.String)
   at System.Configuration.ConfigurationManager.get_AppSettings()
   at Microsoft.ServiceBus.Messaging.SoapProtocolDefaults.IsAvailableClientCertificateThumbprint(System.String ByRef)
   at Microsoft.ServiceBus.Messaging.NetMessagingTransportSettings..ctor()
   at Microsoft.ServiceBus.Messaging.NetMessagingTransportSettings.Clone()
   at Microsoft.ServiceBus.Messaging.MessagingFactorySettings..ctor(Microsoft.ServiceBus.Messaging.MessagingFactorySettings)
   at Microsoft.ServiceBus.Messaging.MessagingFactorySettings.Clone()
   at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageReceiver.BeginReceiveCommand(Microsoft.ServiceBus.Tracing.TrackingContext, Int32, System.TimeSpan, System.String, System.TimeSpan, System.AsyncCallback, System.Object)
   at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageReceiver+ReceiveAsyncResult.<GetAsyncSteps>b__25(ReceiveAsyncResult, System.TimeSpan, System.AsyncCallback, System.Object)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].EnumerateSteps(CurrentThreadType<System.__Canon>)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start()
   at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageReceiver.OnBeginTryReceive(Microsoft.ServiceBus.Tracing.TrackingContext, Int32, System.TimeSpan, System.AsyncCallback, System.Object)
   at Microsoft.ServiceBus.Messaging.MessageReceiver+RetryReceiveAsyncResult.<GetAsyncSteps>b__85(RetryReceiveAsyncResult, System.TimeSpan, System.AsyncCallback, System.Object)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].EnumerateSteps(CurrentThreadType<System.__Canon>)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start()
   at Microsoft.ServiceBus.Messaging.MessageReceiver.BeginTryReceive(Microsoft.ServiceBus.Tracing.TrackingContext, Int32, System.TimeSpan, System.AsyncCallback, System.Object)
   at Microsoft.ServiceBus.Messaging.MessageReceivePump+PumpAsyncResult.<GetAsyncSteps>b__1a(PumpAsyncResult, System.TimeSpan, System.AsyncCallback, System.Object)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].EnumerateSteps(CurrentThreadType<System.__Canon>)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].StepCallback(System.IAsyncResult)
   at Microsoft.ServiceBus.Common.AsyncResult.AsyncCompletionWrapperCallback(System.IAsyncResult)
   at Microsoft.ServiceBus.Common.AsyncResult.TryComplete(Boolean, System.Exception)
   at Microsoft.ServiceBus.Common.AsyncResult.Complete(Boolean, System.Exception)
   at Microsoft.ServiceBus.Messaging.MessageReceiver+RetryReceiveAsyncResult+<GetAsyncSteps>d__97.MoveNext()
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].EnumerateSteps(CurrentThreadType<System.__Canon>)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].StepCallback(System.IAsyncResult)
   at Microsoft.ServiceBus.Common.AsyncResult.AsyncCompletionWrapperCallback(System.IAsyncResult)
   at Microsoft.ServiceBus.Common.AsyncResult.TryComplete(Boolean, System.Exception)
   at Microsoft.ServiceBus.Common.AsyncResult.Complete(Boolean, System.Exception)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].EnumerateSteps(CurrentThreadType<System.__Canon>)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].StepCallback(System.IAsyncResult)
   at Microsoft.ServiceBus.Common.AsyncResult.AsyncCompletionWrapperCallback(System.IAsyncResult)
   at Microsoft.ServiceBus.Common.AsyncResult.TryComplete(Boolean, System.Exception)
   at Microsoft.ServiceBus.Common.AsyncResult.Complete(Boolean, System.Exception)
   at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement+ReconnectChannelFactory`1+RequestSessionChannel+RequestAsyncResult+<GetAsyncSteps>d__11[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].EnumerateSteps(CurrentThreadType<System.__Canon>)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].StepCallback(System.IAsyncResult)
   at Microsoft.ServiceBus.Common.AsyncResult.AsyncCompletionWrapperCallback(System.IAsyncResult)
   at Microsoft.ServiceBus.Common.AsyncResult.TryComplete(Boolean, System.Exception)
   at Microsoft.ServiceBus.Common.AsyncResult.Complete(Boolean, System.Exception)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].HandleException(System.Exception)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].StepCallback(System.IAsyncResult)
   at Microsoft.ServiceBus.Common.AsyncResult.AsyncCompletionWrapperCallback(System.IAsyncResult)
   at Microsoft.ServiceBus.Common.AsyncResult.TryComplete(Boolean, System.Exception)
   at Microsoft.ServiceBus.Common.AsyncResult.Complete(Boolean, System.Exception)
   at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement+ReconnectChannelFactory`1+RequestSessionChannel+RequestAsyncResult+<GetAsyncSteps>d__11[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].EnumerateSteps(CurrentThreadType<System.__Canon>)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].StepCallback(System.IAsyncResult)
   at Microsoft.ServiceBus.Common.AsyncResult.AsyncCompletionWrapperCallback(System.IAsyncResult)
   at Microsoft.ServiceBus.Common.AsyncResult.TryComplete(Boolean, System.Exception)
   at Microsoft.ServiceBus.Common.AsyncResult.Complete(Boolean, System.Exception)
   at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement+DuplexRequestSessionChannel+DuplexCorrelationAsyncResult.TryComplete(Boolean, System.Exception)
   at Microsoft.ServiceBus.Common.IOThreadScheduler+ScheduledOverlapped.IOCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)
   at Microsoft.ServiceBus.Common.Fx+IOCompletionThunk.UnhandledExceptionFrame(UInt32, UInt32, System.Threading.NativeOverlapped*)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)

它看起来像很多内部代码,因为在堆栈跟踪中没有任何一点我可以找到我的应用程序明确启动的代码。我看起来也试图从AppSettings获取配置,但不知何故让自己参与了不安全的方法,导致AccessViolationException。我唯一的线索是我们将SB端点连接字符串存储在connectionStrings中,而不是web.config中的appSettings。

将来是否有办法避免此错误?

0 个答案:

没有答案