We experience a serious bug when application pool recycles for a .net6 Blazor server-side application hosted on windows Azure app service. We have a Mapster mapping between client side ViewModel and DomainModel.

Symptom: Collection items from the ViewModel are duplicated in the DomainModel

Leadup: Application is running fine, then an app pool recycle occurs (triggered by a new deployment, Azure infractructure etc.). Some customers then experience that for every save, which is where the VM->DM mapping occurs, the items in collections in the DomainModel is duplicated.

We have not been able to reproduce the bug in the test environment, only in production. It seems like it may be that only users actively working in the system when the recycle happens are affected by the bug, but we cannot say with 100% certainty.

The error never happens if we stop, then start the app.

What actually happens with the SignalR connections (circuits) when a new app pool is started while the old one is still running? How might that affect the code that is running and what should we look for in the code? We have identified one possible issue with global static non-thread-safe state where the mapping configuration is initialized, which might be an issue because a lot of connections are started in the new app pool simultaneously. Other than that we don't really know what to look for at this stage.

0

There are 0 best solutions below