【问题标题】:ServiceStack.Redis.RedisPoolManagerPool.GetClient() - IndexOutOfRangeExceptionServiceStack.Redis.RedisPoolManagerPool.GetClient() - IndexOutOfRangeException
【发布时间】:2016-01-19 16:49:59
【问题描述】:

我们在 ServiceStack.Redis v4.0.48 中收到以下错误

System.IndexOutOfRangeException:索引超出了数组的范围。 在 ServiceStack.Redis.RedisManagerPool.GetClient() 在 ServiceStack.Redis.RedisClientManagerCacheClient.Set[T](String key, T value, TimeSpan expiresIn) 在 ServiceStack.ServiceExtensions.CacheSet[T](ICacheClient 缓存,字符串键,T 值,Nullable1 expiresIn) at ServiceStack.ServiceStackHost.OnSaveSession(IRequest httpReq, IAuthSession session, Nullable1 expiresIn) 在 ServiceStack.Auth.OAuthProvider.Authenticate(IServiceBase authService, IAuthSession session, Authenticate request) 在 ServiceStack.Auth.AuthenticateService.Authenticate(验证请求,字符串提供程序,IAuthSession 会话,IAuthProvider oAuthConfig) 在 ServiceStack.Auth.AuthenticateService.Post(验证请求) 在ServiceStack.Host.ServiceRunner`1.Execute(IRequest request, Object instance, TRequest requestDto)

我们尝试将池计数增加到 128 个(跨越 3 个实例),但这并没有解决。希望能引起遇到这种情况的人的注意,并能就可能发生的事情提供一些指导……

请告诉我诊断需要哪些额外信息。

【问题讨论】:

  • 您能否尝试升级到最新的 v4.0.52 以查看是否可以解决问题?
  • 是否可以只升级 ServiceStack.Redis 或者我们需要将所有组件升级到相同的版本?
  • 解决方案中的所有包都需要升级到相同版本。
  • 我们已经升级了,现在我们看到一个新问题,它可能与redis重试逻辑有关...A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.Socket.Connect(IPAddress[] addresses, Int32 port) at System.Net.Sockets.Socket.Connect(String host, Int32 port) at ServiceStack.Redis.RedisNativeClient.Connect() at ServiceStack.Redis.RedisNativeClient.TryConnectIfNeeded() at ServiceStack.Redis.RedisNativeClient.AssertConnectedSocket()
  • 这个错误似乎是暂时的 - 我们上次升级时的重试逻辑已经为我们解决了这个错误......不确定这是否是回归。

标签: servicestack asp.net-4.5 servicestack.redis


【解决方案1】:

从@mythz 升级到 4.0.52 的第一条评论最终是解决方案,但重要的是要注意升级会改变 Redis 配置的行为——尤其是它与 Redis 连接字符串相关时。

无论如何,对于 4.0.52,您必须在 RedisConfig 上设置默认值(例如 RedisConfig.DefaultRetryTimeout),即使您在连接字符串中设置了等效值。

【讨论】:

    猜你喜欢
    • 2012-06-11
    • 2012-01-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多