Skip to content

AssemblyLoadContext.Resolving handler may not be thread safe #2134

Closed

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

  1. bricelam commented on Aug 22, 2023

    @bricelam
    Author

    Not, we're still not 100% sure it's your implementation. We're also following up in dotnet/runtime#90415

  2. changed the title [-]AssemblyLoadContext.Resolving handler not thread safe[/-] [+]AssemblyLoadContext.Resolving handler may not be thread safe[/+] on Aug 22, 2023
  3. JRahnama commented on Aug 22, 2023

    @JRahnama
    Contributor

    @bricelam is this M.D.SqlClient related issue or Sqlite?

  4. jkotas commented on Aug 22, 2023

    @jkotas
    Member

    This issue can be closed.

    The EFCore problem is a bug in xunit: dotnet/runtime#90415 (comment).

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