Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync
We had encounter the following error frequently in our application.
Problem Id:
System.NullReferenceException at Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync+<EvalAsync>d__22.MoveNext
Message: Object reference not set to an instance of an object.
Exception type: System.NullReferenceException
Failed method:
Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync+<EvalAsync>d__22.MoveNext
Call Stack:
StackExchange.Redis DLL version: 2.1.58
The application is deployed on Sitecore Managed Cloud Service Azure PaaS and uses Redis app service.
I have applied the below fixes as well as the following articles but the issue is not resolved:
- Increased the min worker thread pool to 100
- Increased polling Interval to 60
- Tuned Redis Configuration as described here: Tuning Redis Configuration Settings
- Added sslprotocols=tls12 to Redis connection string
- Sitecore PAAS Redis Exception
- Azure Web App Redis timeout exceptions when under load
Solution:
After investigation and Google, we have found that our web.config contains the following settings:
<add applicationname="private" compression="true" connectionpoolsize="1"
connectionstring="redis.sessions" connectiontimeoutinmilliseconds="3000"
name="redis" operationtimeoutinmilliseconds="5000" pollinginterval="60"
pollingmaxexpiredsessionspersecond="20" retrytimeoutinmilliseconds="16000"
type="Sitecore.SessionProvider.Redis.RedisSessionStateProviderAsync,
Sitecore.SessionProvider.Redis"/>
<add key="aspnet:AllowConcurrentRequestsPerSession" value="true"/>
Based on this information we can confirm that the reported behavior is a registered bug.
To track the future status of this bug report, please use reference number 505522. More information about public reference numbers can be found here: How to use public reference numbers
To workaround this issue, we consider setting aspnet:AllowConcurrentRequestsPerSession to false. Please note that it is also not recommended to enable aspnet:AllowConcurrentRequestsPerSession according to Sitecore doc as it might cause unexpected behavior such as data loss. For more information please refer to this documentation: Walkthrough: Configuring a private session state database using the Redis provider
However, if you wish to keep aspnet:AllowConcurrentRequestsPerSession enable, you could consider an upgrade to XP 10.3 as this bug is fully resolved in that version.
Happy Sitecoreing 😊
Comments
Post a Comment