Linq: Race condition when getting table definition

Description

We have found this issue a few times now, we have a production system that uses cassandra in low volume, we have cassandra set up as a WCF web service, this error happens unexpectedly, and in un reproducible manner, basically it's random.

System.IndexOutOfRangeException: Index was outside the bounds of the array.\r\n at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)\r\n at System.Collections.ObjectModel.KeyedCollection`2.Contains(TKey key)\r\n at Cassandra.Mapping.PocoDataFactory.AddDefinitionDefault(Type type, Func`1 definitionHandler)\r\n at Cassandra.Data.Linq.SessionExtensions.GetTable[TEntity](ISession session, String tableName, String keyspaceName)\r\n at Brain.Library.Providers.CassandraProvider.Find[T](Expression`1 whereExpression)\r\n at Cassandra.WCF.Service1.GetClientSettings(ClientSettingsModel request)

So far, we have had to restart IIS in order to get rid of the issue.

Environment

None

Activity

Show:
Jorge Bay Gondra
September 12, 2017, 8:08 PM
Edited

The stack trace was useful, thanks .

Could it be that definitions to the MappingConfiguration are being added on a thread, while Table<T> instances are trying to be accessed concurrently on another thread?

Jorge Bay Gondra
September 19, 2017, 8:13 PM

Any updates about this issue?

Jorge Bay Gondra
January 15, 2018, 8:46 PM

I'm closing this one as we don't have enough information to reproduce.

Cannot Reproduce

Assignee

Unassigned

Reporter

Carlos Rodriguez

Labels

Reproduced in

3.3.2

PM Priority

None

Fix versions

None

External issue ID

None

Doc Impact

None

Reviewer

None

Pull Request

None

Epic Link

None

Sprint

None

Pull Requests

None

Size

None

Components

Affects versions

Priority

Major