Concurrency error might prevent a product from being added to the cart, however, the order seems to be created. The issue happens under a high load if a product is added to the cart while the same product is ordered concurrently by another shopper on a storefront website. The root cause of the issue is that the cart is cleared during order creation that leads to an error in the log similar to the following:
PipelineAbort:Can not create order, cart [number] has no lines
To resolve the issue, consider the following solution:
- For Sitecore Experience Commerce 9.3.0:
- Create Commerce Engine plugin as described in Create your first plugin.
- The only needed components of the plugin are pipelines and blocks. The rest of the components can be removed along with the contents of the Pipelines and Blocks folders.
- Add the UpdateItemAvailabilityBlock.cs file under the Pipelines/Blocks folder.
- A new UpdateInventoryInformationWithRetrier method in the sample implements retrying logic.
- Replace the default ConfigureSitecore.cs file in the project root with the attached ConfigureSitecore.cs file.
- Add the plugin project to the dependencies of Sitecore.Commerce.Engine and rebuild the project.
- Deploy the resulting assemblies to the Commerce Engine.