Fix UmbracoMapper InvalidOperationException due to concurrent modification of inner dictionary#15849
Conversation
…ation of inner dictionary (umbraco#15830)
|
Hi there @albinj, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
|
Thanks @albinj - looks good to me, thanks for the assist! 👍 |
Prerequisites
Description
Fixes issue #15830 by changing the inner Dictionary of _ctors to a ConcurrentDictionary.
This concurrency issue was encountered when mapping one type of object to multiple other objects (multiple mapping definitions) and performing multiple concurrent requests when Umbraco boots to a url with a view that did all the mappings at once.
The stack trace points to the UmbracoMapper.GetCtor method as the origin of the exception, indicating that the issue occurs during the retrieval of constructor mappings in concurrent scenarios.
Steps to test
Umbraco.Cms.Web.Common.PublishedModels.FrontPagetoSite.MyModel.