OrchardCore: Unexpected behavior when "ARR affinity" cookies is disabled
Describe the bug
I am running OC CMS by using multiple Azure services. For this app, I am using the following services
- Storage Account to host “dataprotection”, “shell” and media files.
- SQL database to host the data
- Redis cache to distribute my caching
- Azure Web Service for Containers
- Other services that may not be relative to this problem like Azure Registry…
My app is running using 3 instances of the web services. so when a user makes a request to the website there are 3 different instances that could potentially handle the request. I am testing out the app scalability and would like to disable the ARR Affinity cookie. When the ARR cookie is disabled, the app seems to not work as expected. It’s like the app can’t handle the “form post request which is a second request a user would make to submit a web form”.
To Reproduce
Steps to reproduce the behavior:
- Add the following services to the host project
services.AddOrchardCms()
.AddAzureShellsConfiguration()
.AddGlobalFeatures("OrchardCore.DataProtection.Azure");
.AddSetupFeatures("OrchardCore.Redis.Lock")
.AddGlobalFeatures("OrchardCore.Redis.Cache", "OrchardCore.Redis.Lock");
-
Add the following settings in the configuration section in the Azure Web Service a.
OrchardCore__ConnectionString=ConnectionStringToAzureDatabaseb.OrchardCore__DatabaseProvider=SqlConnectionc.OrchardCore__Default__State=Uninitializedd.OrchardCore__Default__TablePrefix=Defaulte.OrchardCore__OrchardCore_DataProtection_Azure__ConnectionString=ConnectionStringToStorageAccountf.OrchardCore__OrchardCore_DataProtection_Azure__ContainerName=dataprotectiong.OrchardCore__OrchardCore_Media_Azure__BasePath=Mediah.OrchardCore__OrchardCore_Media_Azure__ConnectionString=ConnectionStringToStorageAccounti.OrchardCore__OrchardCore_Media_Azure__ContainerName=media-{{ ShellSettings.Name }}j.OrchardCore__OrchardCore_Media_Azure__CreateContainer=truek.OrchardCore__OrchardCore_Redis__Configuration=ConnectiontToTheRedisDatabase,allowAdmin=truel.OrchardCore__OrchardCore_Shells_Azure__ConnectionString=ConnectionStringToStorageAccountm.OrchardCore__OrchardCore_Shells_Azure__ContainerName=hostcontainer -
Make sure you scale out the app service to at least 3 instances

-
Publish the app to azure web service using docker containers.
-
Setup your default site using SaaS recipe. Ensure that the app is working with no know error as it should.
-
Let’s attempt to reproduce the issue now by disabling the ARR Affinity cookie as explained here
-
With the ARR cookies disabled, go to the “Tenants” section of your dashboard and add 2+ new tenant. The results will be that one or more of the tenants won’t be added or show up.
-
If you now enable the ARR Affinity cookie some of the tenants you added in the previous step my show up. Weird?
Expected behavior
When the ARR Affinity cookie is disabled, everything should work the same since my app is using a single instance of the shell, data-protection and distributing my cache using Redis database.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 34 (34 by maintainers)
Okay
For info I was wrong, there is no pooling time, only an idle time and of 1 second.
Maybe worth to try it without idle time or a smaller one