Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis Cache exception StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl #1285

Closed
bhosalemahesh899 opened this issue Nov 21, 2019 · 1 comment

Comments

@bhosalemahesh899
Copy link

I am using Azure Redis Cache, And I am getting following exception for StackExchange Redis cache on dev environment, On local, it is working fine. I am using StackExchange.Redis version 1.2.6. I have tried following config options but still is there is no success.

Redis connection `

Expiry = new TimeSpan(1000000);
string cacheConnectionString = "";//redis cache connection string
var configOptions = ConfigurationOptions.Parse(cacheConnectionString);
configOptions.SyncTimeout = 5000;
configOptions.ResponseTimeout = 5000;
configOptions.ConnectTimeout = 50000;
configOptions.ConnectRetry = 5;
configOptions.AbortOnConnectFail = false;

lazyConnection = new Lazy<ConnectionMultiplexer>(() =>
{
  return ConnectionMultiplexer.Connect(configOptions);
});

cache = lazyConnection.Value.GetDatabase();'

I am getting the following exception.
StackExchange.Redis.RedisConnectionException: SocketClosed on GET
at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor1 processor, ServerEndPoint server) at
StackExchange.Redis.RedisBase.ExecuteSync[T](Message message,
ResultProcessor1 processor, ServerEndPoint server) at StackExchange.Redis.RedisDatabase.StringGet(RedisKey key, CommandFlags flags) at Decos.Fixi.Data.CacheServices.BaseCacheService.Get[T](String key) in E:_work3\6\s\Fixi2\Main\Decos.Fixi.Api\Decos.Fixi.Data\CacheServices\BaseCacheService.cs:line 73 at Decos.Fixi.Data.CacheServices.UserCacheService.GetValue(String userId, Get getFromDatabase, Boolean toGetFromDatabase) in E:_work3\6\s\Fixi2\Main\Decos.Fixi.Api\Decos.Fixi.Data\CacheServices\UserCacheService.cs:line 37 at Decos.Fixi.Data.Services.UserService.GetUserAsync(Nullable1
decosUserID, String googleUserID, String facebookUserID, Nullable1 azureADObjectId, Boolean toGetFromDatabase) in E:_work3\6\s\Fixi2\Main\Decos.Fixi.Api\Decos.Fixi.Data\Services\UserService.cs:line 96 at Decos.Fixi.WebApi.Annotations.AuthenticateApplicationAttribute.GetUserAsync(HttpRequestMessage requestMessage, IUserProvider userProvider) in E:_work3\6\s\Fixi2\Main\Decos.Fixi.Api\Decos.Fixi.WebApi\Annotations\ApplicationAuthenticationAttribute.cs:line 188 at Decos.Fixi.WebApi.Annotations.AuthenticateApplicationAttribute.d__14.MoveNext() in E:_work3\6\s\Fixi2\Main\Decos.Fixi.Api\Decos.Fixi.WebApi\Annotations\ApplicationAuthenticationAttribute.cs:line 0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Decos.Fixi.WebApi.Annotations.AuthenticateApplicationAttribute.d__15.MoveNext() in E:_work3\6\s\Fixi2\Main\Decos.Fixi.Api\Decos.Fixi.WebApi\Annotations\ApplicationAuthenticationAttribute.cs:line 179 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Decos.Fixi.WebApi.Annotations.AuthenticateApplicationAttribute.d__7.MoveNext() in E:_work3\6\s\Fixi2\Main\Decos.Fixi.Api\Decos.Fixi.WebApi\Annotations\ApplicationAuthenticationAttribute.cs:line 95 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.AuthenticationFilterResult.d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ExceptionFilterResult.d__0.MoveNext()",80000b3a-0000-e500-b63f-84710c7967bb

Thanks in advance!
Mahesh Bhosale

@NickCraver
Copy link
Collaborator

In short, 1.2.6 does not handle network failures great, that's why it the networking layer was a massive rewrite project for the 2.x release. We highly recommend upgrading to the 2.x version on the client which has a lot more info available and will generally handle failure better. Note: some additional fixes for 2.x are in queue in #1374.

Happy to answer more questions, just trying to tidy up issues and defaulting to closing this one out since there will be no more 1.x releases of the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants