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

Fix for #1217 #1239

Closed
wants to merge 1 commit into from
Closed

Fix for #1217 #1239

wants to merge 1 commit into from

Conversation

chrfin
Copy link
Contributor

@chrfin chrfin commented Sep 7, 2019

This change should fix #1217
I am aware that GetOrAdd is not thread-safe, but according to the list under remarks at https://docs.microsoft.com/en-us/dotnet/api/system.collections.concurrent.concurrentdictionary-2.getoradd it should not cause any problems in this case.

Copy link

@Seabizkit Seabizkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe i was a bit quick with this, and do not know how to delete now. sorry.

@kosinsky
Copy link
Contributor

In our logs I found that it fails with Null ref exception in the same place as in #1217.
Looks like this PR fixes it too. but just in case full stack trace:

System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Data.Entity.Core.Query.InternalTrees.BitVec.ArrayPool.GetBag(Int32 length)
   at System.Data.Entity.Core.Query.InternalTrees.BitVec.ArrayPool.GetArray(Int32 length)
   at System.Data.Entity.Core.Query.InternalTrees.BitVec..ctor(Int32 length, Boolean defaultValue)
   at System.Data.Entity.Core.Query.InternalTrees.Command.CreateVarVec()
   at System.Data.Entity.Core.Query.InternalTrees.Table..ctor(Command command, TableMD tableMetadata, Int32 tableId)
   at System.Data.Entity.Core.Query.InternalTrees.Command.CreateTableInstance(TableMD tableMetadata)
   at System.Data.Entity.Core.Query.PlanCompiler.ITreeGenerator.Visit(DbScanExpression e)
   at System.Data.Entity.Core.Query.PlanCompiler.ITreeGenerator.VisitBoundExpression(DbExpression boundExpression, Var& boundVar)
   at System.Data.Entity.Core.Query.PlanCompiler.ITreeGenerator.EnterExpressionBinding(DbExpressionBinding binding)
   at System.Data.Entity.Core.Query.PlanCompiler.ITreeGenerator.Visit(DbFilterExpression e)
   at System.Data.Entity.Core.Query.PlanCompiler.ITreeGenerator..ctor(DbQueryCommandTree ctree, DiscriminatorMap discriminatorMap)
   at System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler.Initialize()

@ajcvickers
Copy link
Member

@chrfin Can you re-submit this against release/6.4?

@chrfin
Copy link
Contributor Author

chrfin commented Oct 30, 2019

No problem, will do so...

@chrfin chrfin closed this Oct 30, 2019
@chrfin
Copy link
Contributor Author

chrfin commented Oct 30, 2019

@ajcvickers Please see #1426

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

Successfully merging this pull request may close these issues.

4 participants