Repository navigation
Fix: "A concurrent update was performed on this collection and corrupted its state." - #1146
Conversation
…ed objects that modify it to avoid state corruption.
|
Perhaps a cleaner fix would be to make the middleware factory based instead of singleton. We had the same bug and wrote our own middleware wrapper which would instantiate and invoke an instance of the SoapCoreMiddleware per request. If the middleware would just be registered as transient then this issue would also be resolved. |
|
I get the same error message. Did you guys already implemented a work around or are you still waiting on the merge request to be merged? |
|
We implemented a workaround. See issue #743. |
|
Thank you for this PR! Looks good! This bug was most likely introduced by the caching that I added in #1123 so the cleanest fix would be to simply remove that, but I prefer this PR since we get to keep the perf benefits of caching. It would be fairly easy to implement a custom XmlNamespaceManager that uses a ConcurrentDictionary instead of a Dictionary, but that could become a mess if Microsoft ever changes the implementation of XmlNamespaceManager. So I'll get this PR merged now. Thanks again! |
Fix: "A concurrent update was performed on this collection and corrupted its state."
Don't share XmlNamespaceManager kept in a singleton with request scoped objects that modify it to avoid state corruption.
XmlNamespaceManager Is not thread safe!