Skip to content

AssemblyLoadContext.Resolving handler may not be thread safe #2134

Description

@bricelam

We've started seeing occasional failures in our tests with the following exception:

Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpRuntimeModelCodeGeneratorTest.Sqlite [FAIL]
  System.TypeInitializationException : The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception.
  ---- System.IO.FileLoadException : Could not load file or assembly 'Microsoft.Windows.SDK.NET, Culture=neutral, PublicKeyToken=null'. An operation is not legal in the current state. (0x80131509)
  -------- System.InvalidOperationException : Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.
  Stack Trace:
    D:\a\_work\1\s\src\Microsoft.Data.Sqlite.Core\SqliteConnection.cs(95,0): at Microsoft.Data.Sqlite.SqliteConnection..ctor()

As far as we can tell, this is being caused by your Microsoft.Data.SqlClient.SqlConfigurableRetryLogicLoader.Default_Resolving() handler not being thread safe.

/cc @ajcvickers

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions