c# – Microsoft Azure Service Bus Timeout Exceptions

前端之家收集整理的这篇文章主要介绍了c# – Microsoft Azure Service Bus Timeout Exceptions前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我们有一个在Microsoft Azure云平台上运行的应用程序.某些组件之间的通信使用Service Bus进行.一切都运行正常,直到最近我们才开始获得以下类型的超时异常:

调用QueueClient x.Send(…)时

Exception rethrown at [0]: at
Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult
result) at
Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.DuplexCorrelationAsyncResult.End(IAsyncResult
result) at
Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory `1.RequestSessionChannel.RequestAsyncResult.b__4(RequestAsyncResult
thisPtr,IAsyncResult r) at
Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult
result)

调用NamespaceManager x.GetQueue(…)时

PROGRESS queue processing Failed. System.TimeoutException: The request
has timed out after 60000 milliseconds. The successful completion of
the request cannot be determined. Additional queries should be made to
determine whether or not the operation has succeeded.
TrackingId:bdffb6bd-5367-4573-aaa3-8ea9a03f5a2b,TimeStamp:5/28/2015
8:39:46 AM —> System.Net.WebException: The request was aborted: The
request was canceled. at
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at
Microsoft.ServiceBus.Messaging.ServiceBusResourceOperations.GetAsyncResult`1.b__49(GetAsyncResult`1
thisPtr,IAsyncResult r) at
Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult
result)

调用NamespaceManager x.SubscriptionExists(…)时

Exception doing periodic work: System.TimeoutException: The request
has timed out after 00:10:00 milliseconds. The successful completion
of the request cannot be determined. Additional queries should be made
to determine whether or not the operation has succeeded. Server stack
trace: Exception rethrown at [0]: at
Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult
result) at
Microsoft.ServiceBus.NamespaceManager.OnEndSubscriptionExists(IAsyncResult
result) at
Microsoft.ServiceBus.NamespaceManager.SubscriptionExists(String
topicPath,String name) …

调用QueueClient x.Receive(…)时

PROGRESS queue processing Failed.
Microsoft.ServiceBus.Messaging.MessagingCommunicationException: Error
during communication with Service Bus. Check the connection
information,then retry. —>
System.ServiceModel.CommunicationObjectFaultedException: Internal
Server Error: The server did not provide a meaningful reply; this
might be caused by a premature session shutdown.
TrackingId:04ba0220-0350-4806-9c65-c2bba9671054,Timestamp:28.05.2015
13:00:55 Server stack trace: Exception rethrown at [0]: at
Microsoft.ServiceBus.Common.ExceptionDispatcher.Throw(Exception
exception) at
Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult
result) at
Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.DuplexCorrelationAsyncResult.End(IAsyncResult
result) at
Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.EndRequest(IAsyncResult
result) at
Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.RequestAsyncResult.b__4(RequestAsyncResult
thisPtr,IAsyncResult r) at
Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult
result) ….

例外与ServiceBus明显相关,并且它们是非确定性的.抛出它们的函数,例如Send,GetQueue,SubscriptionExists,每分钟被调用不超过100-120次.我们在代码中没有改变任何内容,并且增加超时值(即使是非常高的值,比如10分钟)也无济于事.此外,我们不相信它是一些与网络相关的问题(在我们这边),因为当应用程序从不同的地方运行时会发生同样的错误.

最近有没有其他人遇到过这种例外情况?微软是否存在问题,或者我们遗漏了什么?

解决方法

几个星期前,我们的服务总线应用程序突然出现了无法解释的时间问题,该应用程序已投入生产数月.我们继续工作,但每次通话需要10秒,通常为100-200毫秒.这持续了几个星期,我花了大部分时间试图弄清楚发生了什么,从未做过,因为问题突然消失了.

我们确实了解到,我们在相同和其他数据中心中创建的新Service Bus命名空间用于在问题发生时进行测试时没有出现相同的问题. Service Bus组没有提供任何帮助,只会说只有SLA才能保证响应时间.

猜你在找的C#相关文章