Skip to content

Weird exception upon upgrading to 5.3.3 #319

@kooshan

Description

@kooshan

Thank you for all the good work on this library. I constantly get this exception on some of my background hosted service, which are quite new I guess after upgrading to the new version.

dotnet sdk version: 9.0.306
package version: 5.3.3

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Threading.SemaphoreSlim'.
   at System.Threading.SemaphoreSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.SemaphoreSlim.Wait(TimeSpan timeout, CancellationToken cancellationToken)
   at EFCoreSecondLevelCacheInterceptor.SecondLevelCacheInterceptor.ReaderExecuting(DbCommand command, CommandEventData eventData, InterceptionResult`1 result) in D:\a\EFCoreSecondLevelCacheInterceptor\EFCoreSecondLevelCacheInterceptor\src\EFCoreSecondLevelCacheInterceptor\SecondLevelCacheInterceptor.cs:line 133
   at Microsoft.EntityFrameworkCore.Diagnostics.Internal.DbCommandInterceptorAggregator.CompositeDbCommandInterceptor.ReaderExecuting(DbCommand command, CommandEventData eventData, InterceptionResult`1 result)
   at Microsoft.EntityFrameworkCore.Diagnostics.Internal.RelationalCommandDiagnosticsLogger.CommandReaderExecuting(IRelationalConnection connection, DbCommand command, DbContext context, Guid commandId, Guid connectionId, DateTimeOffset startTime, CommandSource commandSource)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.Enumerator.InitializeReader(Enumerator enumerator)
   at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.Enumerator.<>c.<MoveNext>b__22_0(DbContext _, Enumerator enumerator)
   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass28_0`2.<Execute>b__0(DbContext context, TState state)
   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementation[TState,TResult](Func`3 operation, Func`3 verifySucceeded, TState state)
   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.Enumerator.MoveNext()
   at Microsoft.EntityFrameworkCore.Internal.EntityFinder`1.Load(INavigation navigation, InternalEntityEntry entry, LoadOptions options)
   at Microsoft.EntityFrameworkCore.Internal.EntityFinderCollectionLoaderAdapter.Load(InternalEntityEntry entry, LoadOptions options)
   at Microsoft.EntityFrameworkCore.ChangeTracking.CollectionEntry.Load(LoadOptions options)
   at Microsoft.EntityFrameworkCore.Infrastructure.Internal.LazyLoader.Load(Object entity, String navigationName)
   at Microsoft.EntityFrameworkCore.Proxies.Internal.LazyLoadingInterceptor.Intercept(IInvocation invocation)
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.Proxies.UserProxy.get_Tokens()
   at InvokeStub_UserProxy.get_Tokens(Object, Object, IntPtr*)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions