Skip to content

SqliteConnectionFactory.cs is not thread-safe #26612

Closed

Description

Reads on the Dictionary are not locked with the write operations, which is not supported.
Suggestion is to use a ConcurrentDictionary and remove some of the locks, or use a ReaderWriterLockSlim.

https://github.com/dotnet/efcore/blob/main/src/Microsoft.Data.Sqlite.Core/SqliteConnectionFactory.cs#L53

c.f. Dictionary source that is can throw an exception if the collection was changed while reads occur.
https://source.dot.net/#System.Private.CoreLib/Dictionary.cs,398

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

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions