The Timeout was Reached Before the Message in Sitecore Redis
While working on Sitecore PaaS you have a Redis issue. This time we have a Redis timeout issue but with a different message:
message: | |
{ | |
"ClassName": "StackExchange.Redis.RedisTimeoutException", | |
"Message": "The timeout was reached before the message could be written to the output buffer, and it was not sent, command=GET, timeout: 5000, outbound: 0KiB, inbound: 0KiB, active: GET TaxDetail:KNIMIL01:2024-03-23/2024-03-24:1-1-0:PK004BBB-STD0001D230 ** possible thread-theft indicated; see https://stackexchange.github.io/StackExchange.Redis/ThreadTheft ** , inst: 0, qu: 0, qs: 0, aw: True, rs: CompletePendingMessageSync, ws: Idle, in: 0, serverEndpoint: mc- ********-****-****-****-****-redis.redis.cache.windows.net:6380, mc: 1/1/0, mgr: 9 of 10 available, clientName: wn6ttgvk243248, IOCP: (Busy=0,Free=1000,Min=2,Max=1000), WORKER: (Busy=82,Free=918,Min=100,Max=1000), v: 2.1.58.34321 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)", | |
"Data": { | |
"Redis-Message": "GET HotelSubNavbar:web:{833DDAE1-EE2A-4F5D-B4A7-7F45YH9FF7FB}_en", | |
"Redis-Timeout": "5000", | |
"Redis-Write-State": "Idle", | |
"Redis-Read-State": "CompletePendingMessageSync", | |
"Redis-OutboundDeltaKB": "0KiB", | |
"Redis-InboundDeltaKB": "0KiB", | |
"Redis-Message-Current": "GET TaxDetail:KNIMIL01:2024-03-23/2024-03-24:1-1-0:PK004BBB-STD0001D230", | |
"Redis-OpsSinceLastHeartbeat": "0", | |
"Redis-Queue-Awaiting-Write": "0", | |
"Redis-Queue-Awaiting-Response": "0", | |
"Redis-Active-Writer": "True", | |
"Redis-Inbound-Bytes": "0", | |
"Redis-Server-Endpoint": "mc- ********-****-****-****-****-redis.redis.cache.windows.net:6380", | |
"Redis-Multiplexer-Connects": "1/1/0", | |
"Redis-Manager": "9 of 10 available", | |
"Redis-Client-Name": "wn0sdwk000248", | |
"Redis-ThreadPool-IO-Completion": "(Busy=0,Free=1000,Min=2,Max=1000)", | |
"Redis-ThreadPool-Workers": "(Busy=82,Free=918,Min=100,Max=1000)", | |
"Redis-Busy-Workers": "82", | |
"Redis-Version": "2.1.58.34321", | |
"redis-command": "GET HotelSubNavbar:web:{833RHGE1-EB2A-4R5D-BG5A7-7FD88A9FF7FB}_en", | |
"request-sent-status": 1, | |
"redis-server": "mc- ********-****-****-****-****-redis.redis.cache.windows.net:6380" | |
}, | |
"InnerException": null, | |
"HelpURL": "https://stackexchange.github.io/StackExchange.Redis/Timeouts", | |
"StackTraceString": " at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 2803\r\n at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in /_/src/StackExchange.Redis/RedisBase.cs:line 54\r\n at StackExchange.Redis.RedisDatabase.StringGet(RedisKey key, CommandFlags flags) in /_/src/StackExchange.Redis/RedisDatabase.cs:line 2374\r\n at ***********.Unity.Caching.RedisCacheManager.Get(String key) in D:\\a\\1\\s\\core\\***********.Unity.Caching\\RedisCacheManager.cs:line 293", | |
"RemoteStackTraceString": null, | |
"RemoteStackIndex": 0, | |
"ExceptionMethod": "8\nExecuteSyncImpl\nStackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46\nStackExchange.Redis.ConnectionMultiplexer\nT ExecuteSyncImpl[T](StackExchange.Redis.Message, StackExchange.Redis.ResultProcessor`1[T], StackExchange.Redis.ServerEndPoint)", | |
"HResult": -2146233083, | |
"Source": "StackExchange.Redis", | |
"WatsonBuckets": null, | |
"commandStatus": 1 | |
} |
Solution:
After conducting research and using Google, I have discovered that there are 2 links from the above exception:
- https://stackexchange.github.io/StackExchange.Redis/Timeouts
- https://stackexchange.github.io/StackExchange.Redis/ThreadTheft
I am experiencing the "thread theft" of the reader. The parameter "rs" in the error message tells me the state of the reader. If this is frequently reporting CompletePendingMessage, it is possible that the reader loop has been hijacked when trying to set results. It's further elaborated in the Thread Theft.
To address this issue try adding the following early on in your application startup:
ConnectionMultiplexer.SetFeatureFlag("preventthreadtheft", true);
The issue is more related to the StackExchange.Redis communities instead of Sitecore Support. If you continue to encounter the problem, reach out to StackExchange.Redis for assistance.
Happy Sitecoreing 😊
Comments
Post a Comment