Commerce Engine experiences thread starvation on start up due to lock contention in RedisCacheConnectionPoolManager


Description

Commerce Engine might experience the outage on start up. This happens due to the starvation of threads resolving Commerce entities from cache. When populating a connection pool with connection objects, some incoming requests contend on the lock and block each other, especially if there are many requests at the same time.
The issue occurs after installing the Hotfix Rollup Package.

Solution

You can populate- a connection pool with connection objects directly instead of accessing it via cache object:

  1. Download the Startup.cs file that populates Redis connection pool with connection objects during application start.
  2. Open Customer.Sample.Solution from Commerce Engine SDK.
  3. Navigate to Sitecore.Commerce.Engine project.
  4. Replace code of ConfigureServices(...) method that executes before Configure(...) method with the code from the Sample.cs file.
  5. Build Sitecore.Commerce.Engine project and deploy resulting assemblies to your Commerce instance.