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

ListShardMap.TryGetMappingForKey intermittently throwing InvalidOperationException #206

Open
muiriswoulfe opened this issue Mar 20, 2020 · 0 comments

Comments

@muiriswoulfe
Copy link

muiriswoulfe commented Mar 20, 2020

ListShardMap.TryGetMappingForKey is intermittently throwing an InvalidOperationException, within the call to the .Single() LINQ function.

It is expected that a TryGet... method doesn't throw but instead returns a status code.

We're using the latest version of the library as of the time of writing – v2.3.0.

We're currently trying to track down the precise conditions under which this exception occurs, but it only happens intermittently at irregular intervals so I'm unable to elucidate further at this time. I will update this issue once we have more details. In the interim, it would be great if you could investigate fixing this and we'd appreciate any advice into how we might have encountered this state.

The callstack at the point of the exception is:

An unhandled exception has occurred while executing the request. Exception: System.InvalidOperationException: Sequence contains no elements\n
at System.Linq.ThrowHelper.ThrowNoElementsException()\n   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)\n
at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.BaseShardMapper.Lookup[TMapping,TKey](TKey key, LookupOptions lookupOptions, Func`4 constructMapping, ShardManagementErrorCategory errorCategory)\n
at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.ListShardMapper`1.TryLookup(TKey key, LookupOptions lookupOptions, PointMapping`1& mapping)\n
at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.ListShardMap`1.TryGetMappingForKey(TKey key, LookupOptions lookupOptions, PointMapping`1& pointMapping)\n
at [our code]
@muiriswoulfe muiriswoulfe changed the title ListShardMap.TryGetMappingForKey intermittently throwing InvalidOperationException ListShardMap.TryGetMappingForKey intermittently throwing InvalidOperationException Mar 20, 2020
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

1 participant