StackExchange / StackExchange/StackExchange.Redis

Timeout error when using redis session

Open
#2,796 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.2k
Forks
1.6k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

I am getting a lot of time out errors after moving our application to redis session state. we usually get either of the following 2 messages:

Timeout performing EVAL (5000ms), next: EVAL, inst: 21, qu: 0, qs: 0, aw: False, bw: SpinningDown, rs: DequeueResult, ws: Idle, in: 0, last-in: 0, cur-in: 54, sync-ops: 579, async-ops: 1, serverEndpoint: xxx.cache.windows.net:6380, conn-sec: 115.79, aoc: 0, mc: 1/1/0, mgr: 9 of 10 available, clientName: wn0sdwk0003PY(SE.Redis-v2.8.0.27420)(Microsoft.Web.RedisSessionStateProvider-v5.1.0.0), IOCP: (Busy=1,Free=999,Min=400,Max=1000), WORKER: (Busy=107,Free=32660,Min=400,Max=32767), v: 2.8.0.27420 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)

and

Timeout performing EVAL (5000ms), active: EVAL, next: UNKNOWN, inst: 30, qu: 2, qs: 0, aw: True, bw: CheckingForTimeoutComplete, rs: DequeueResult, ws: Writing, in: 0, last-in: 0, cur-in: 20848, sync-ops: 591, async-ops: 1, serverEndpoint: xxx.redis.cache.windows.net:6380, conn-sec: 118.67, aoc: 0, mc: 1/1/0, mgr: 9 of 10 available, clientName: wn0sdwk0003PY(SE.Redis-v2.8.0.27420)(Microsoft.Web.RedisSessionStateProvider-v5.1.0.0), IOCP: (Busy=0,Free=1000,Min=400,Max=1000), WORKER: (Busy=111,Free=32656,Min=400,Max=32767), v: 2.8.0.27420 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)

and the stack trace:

StackExchange.Redis.RedisTimeoutException: at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl (StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46) at StackExchange.Redis.RedisDatabase.ScriptEvaluate (StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46) at Microsoft.Web.Redis.StackExchangeClientConnection+<>c__DisplayClass6_0.<Eval>b__0 (Microsoft.Web.RedisSessionStateProvider, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null) at Microsoft.Web.Redis.StackExchangeClientConnection.OperationExecutor (Microsoft.Web.RedisSessionStateProvider, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null) at Microsoft.Web.Redis.StackExchangeClientConnection.RetryLogic (Microsoft.Web.RedisSessionStateProvider, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null) at Microsoft.Web.Redis.StackExchangeClientConnection.Eval (Microsoft.Web.RedisSessionStateProvider, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null) at Microsoft.Web.Redis.RedisConnectionWrapper.TryTakeWriteLockAndGetData (Microsoft.Web.RedisSessionStateProvider, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null) at Microsoft.Web.Redis.RedisSessionStateProvider.GetItemFromSessionStore (Microsoft.Web.RedisSessionStateProvider, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null) at Microsoft.Web.Redis.RedisSessionStateProvider+<GetItemExclusiveAsync>d__19.MoveNext (Microsoft.Web.RedisSessionStateProvider, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at Microsoft.AspNet.SessionState.SessionStateModuleAsync+<GetSessionStateItemAsync>d__74.MoveNext (Microsoft.AspNet.SessionState.SessionStateModule, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at Microsoft.AspNet.SessionState.SessionStateModuleAsync+<AcquireStateAsync>d__65.MoveNext (Microsoft.AspNet.SessionState.SessionStateModule, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at Microsoft.AspNet.SessionState.TaskAsyncHelper.EndTask (Microsoft.AspNet.SessionState.SessionStateModule, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at System.Web.HttpApplication+AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) at System.Web.HttpApplication+<>c__DisplayClass285_0.<ExecuteStepImpl>b__0 (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) at System.Web.HttpApplication.ExecuteStepImpl (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) at System.Web.HttpApplication.ExecuteStep (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)

Any ideas on what might be causing these? Thank you

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked timeout diagnostics and trace the reported path from RedisDatabase.ScriptEvaluate through StackExchangeClientConnection and RedisSessionStateProvider. The issue names no repository file or test and gives no reproduction or acceptance criterion, so first establish a reproducible cause and a verifiable fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, redis
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.