Azure / Azure/elastic-db-tools
ShardMapManager TryGetListShardMap throws System.ExecutionEngineException with too many inits
- Dominant language
- C#
- Stars
- 147
- Forks
- 108
- PR merge metrics
- No merged PRs in 30d
Description
I recently experienced a issue with the ShardMapManager that may or may not be related to how I used it. I built a Interface to allow me to resolve my EF Context and inside the context I init a ShardMapManager to find the shard it is to use. This was working fine up until my Multitenant Application reached ~160 databases. When I hit that point, my Webjob responsible for doing scheduled tasks against each shard was unexpectedly failing. To troubleshoot the issue I needed to remote debug into my Webjob. All I got was the following: Exception of type 'System.ExecutionEngineException' was thrown.
After reading up on this exception, it seems to be related to some unmanaged code messing up the state of the application. On a hunch I pulled out the ShardMapManager and only init once and give a reference of it to my context. This resolved my issue but I wanted to put it on your radar if anyone else is experiencing this issue.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.