Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShardMapManager TryGetListShardMap throws System.ExecutionEngineException with too many inits #153

Open
brainded opened this issue May 16, 2017 · 2 comments

Comments

@brainded
Copy link

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.

@jaredmoo
Copy link
Contributor

Wow, ExecutionEngineException? How bizarre. Thanks for the heads up.

Yes it's best to only create one instance of ShardMapManager since it contains a cache, and it's better to have only one instance of the cache used throughout your application. :)

@brainded
Copy link
Author

I may have jumped the gun... moving the ShardMapManager out helped alleviate but not resolve the problem. I will continue working on trying to find the root cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants