2013-02-20 33 views
8

我在使用Windows Azure缓存与模拟器(即在本地而非云上)时遇到问题。调试时的Windows Azure缓存 - 请求超时

我的系统配置是:

  • 的Windows 8
  • 的Visual Studio 2012更新1
  • Azure的SDK和模拟器1.8
  • 的Windows Azure缓存1.8.1
  • 的Web API
  • .NET 4.5

问题是:我们的服务器利用(在角色中)用于会话管理的Windows Azure缓存等。一旦服务器获取来自客户端的请求,它就开始与Windows Azure缓存进行通信,以便放置/获取一些对象(例如会话对象) 。然后发生“超时”异常(Microsoft.ApplicationServer.Caching.DataCacheException)并且服务器无响应,在Visual Studio的输出日志中显示以下消息。

... 
iisexpress.exe Error: 0 : ERROR: <DistributedCache.RoutingClient> 25cb6980-94c5-4e72- adee-cd58defff7fe:SendMsgAndWait: Request TimedOut, msgId = 77 

A first chance exception of type 'Microsoft.ApplicationServer.Caching.DataCacheException' occurred in Microsoft.ApplicationServer.Caching.Client.dll 

'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll' 
iisexpress.exe Error: 0 : The thread '<No Name>' (0x16d0) has exited with code 0 (0x0). 

The thread '<No Name>' (0x1a00) has exited with code 0 (0x0). 
The thread '<No Name>' (0x2298) has exited with code 0 (0x0). 

ERROR: <DistributedCache.RoutingClient> e91ff46b-870c-4d83-8eef-6bdb718baab9:SendMsgAndWait: Request TimedOut, msgId = 78 

iisexpress.exe Warning: 0 : Microsoft.WindowsAzure.ServiceRuntime Verbose: 500 : Role instance status check starting 

Microsoft.WindowsAzure.ServiceRuntime Verbose: 502 : Role instance status check succeeded: Ready 

WARNING: <SimpleSendReceiveModule> DeadServerCallback Called, Server URI: [net.tcp://127.255.0.0:20004], Underlying exception - 

A first chance exception of type 'Microsoft.ApplicationServer.Caching.DataCacheException' occurred in Microsoft.ApplicationServer.Caching.Client.dll 

iisexpress.exe Warning: 0 : WARNING: <SimpleSendReceiveModule> DeadServerCallback Called, Server URI: [net.tcp://127.255.0.0:20004], Underlying exception - 

iisexpress.exe Warning: 0 : WARNING: <SimpleSendReceiveModule> DeadServerCallback: Matches My Server, Cleaning Pending Requests 

iisexpress.exe Warning: 0 : WARNING: <SimpleSendReceiveModule> 48c1dd7f-f54d-40a8-9990-25af48b91eb1:Request - 79, result - Status=SendFailed[System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host 

    at System.Net.Sockets.Socket.Send(IList`1 buffers) 

    at Microsoft.ApplicationServer.Caching.TcpSocketChannel.Send(IList`1 buffers, TimeSpan timeout)] 

iisexpress.exe Warning: 0 : WARNING: <SimpleSendReceiveModule> DeadServerCallback: Matches My Server, Cleaning Pending Requests 

A first chance exception of type 'Microsoft.ApplicationServer.Caching.DataCacheException' occurred in Microsoft.ApplicationServer.Caching.Client.dll 

iisexpress.exe Warning: 0 : WARNING: <DistributedCache.SocketClientChannel.1> Request 81 to host net.tcp://127.255.0.0:20004/ failed Status=ChannelOpening 

iisexpress.exe Warning: 0 : WARNING: <DistributedCache.SocketClientChannel.1> Request 80 to host net.tcp://127.255.0.0:20004/ failed Status=ChannelOpening 

iisexpress.exe Warning: 0 : WARNING: <SimpleSendReceiveModule> 8ec8ff74-1f04-49da-8ff5-529d0697542f:Request - 81, result - Status=ChannelOpening 

iisexpress.exe Warning: 0 : A first chance exception of type 'Microsoft.ApplicationServer.Caching.DataCacheException' occurred in Microsoft.ApplicationServer.Caching.Client.dll 

当这种情况发生时,服务器刚刚关闭(即正在运行,但没有响应)。

任何想法为什么发生这种情况?它与Windows 8有关吗?

感谢,

回答

1

我也有这个问题,追查下来的Hyper-V虚拟以太网适配器一台机器上。禁用我安装的两个适配器修复了Azure缓存中的超时错误。在这台机器上,我可以继续保持连接到网络/互联网。

在另一台机器上没有安装Hyper-V,并且禁用以太网适配器(断开与互联网的连接)“修复”了问题。所以要运行我的应用程序,我必须首先每次断开与网络的连接。

在这两台机器上,对缓存服务器(例如127.255.0.0,127.255.0.1,127.255.0.2等)进行IP查找时,Azure缓存开发似乎遇到问题,它适用于几个请求,然后开始超时。从网络断开时,它始终有效。

在开始发生问题之前的几个月,这对我而言在Windows 8机器上工作得很好。

更新

冲洗固定这对我来说DNS缓存,现在它的工作原理,同时连接到网络。 ipconfig /flushdns

+1

感谢您分享您的经验! :) – soleiljy 2013-10-02 23:05:16

0

我还没有能够完全确认这一点,但这个问题似乎与在azure缓存dll中的遗留协议有关。

我能够在我的默认缓存运行此配置来解决这个问题:

<dataCacheClient name="default" isCompressionEnabled="false" maxConnectionsToServer="4" useLegacyProtocol="false" > 

希望这有助于