Skip to content

Commit

Permalink
Correctly remove locks in query caches (#21367)
Browse files Browse the repository at this point in the history
Fixes #21245
  • Loading branch information
roji committed Jun 22, 2020
1 parent 91f1937 commit 7c209ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public virtual IRelationalCommand GetRelationalCommand([NotNull] IReadOnlyDictio
}
finally
{
_locks.TryRemove(compilationLock, out _);
_locks.TryRemove(cacheKey, out _);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/EFCore/Query/Internal/CompiledQueryCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public virtual Func<QueryContext, TResult> GetOrAddQuery<TResult>(
}
finally
{
_locks.TryRemove(compilationLock, out _);
_locks.TryRemove(cacheKey, out _);
}
}
}
Expand Down

0 comments on commit 7c209ea

Please sign in to comment.