dotnet / efcore

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
https://docs.microsoft.com/ef/
MIT License
13.65k stars 3.15k forks source link

Consider the SQLite timeout mechanism #31359

Open roji opened 1 year ago

roji commented 1 year ago

The current timeout mechanism on SqliteDataReader aggregates time spent across all invocations of NextResult(); we can consider making the timeout not aggregate, i.e. specific to each invocation instead. This would align the behavior with most other ADO.NET drivers, and may make more sense.

See conversation in https://github.com/dotnet/efcore/pull/31348#discussion_r1273343845

roji commented 1 year ago

On a very related, we may want to consider making CommandTimeout actually cancel statements which run for too long; SQLite doesn't have the networking problems other databases do, but severely un-optimized queries can still run "forever".

This is probably also related to making SqliteCommand.Cancel() actually cancel the currently-running command (and possibly also the cancellation token argument of the async execution APIs).