You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.
100% CPU (on single core) usage while waiting for table to unlock during read.
Minimal repro steps
Lock a table
Run select command against locked table
Observe CPU spike
i.e.
using (var connectionA = new SqliteConnection("Data Source=testdb;Mode=Memory;Cache=Shared")) {
connectionA.Open();
var cmd1 = connectionA.CreateCommand();
cmd1.CommandText = "CREATE TABLE Person ( Name nvarchar(4000) )";
cmd1.ExecuteNonQuery();
using (var transactionA = connectionA.BeginTransaction(IsolationLevel.Serializable)) {
cmd1.CommandText = "insert into Person values ( 'joe' )";
cmd1.Transaction = transactionA;
cmd1.ExecuteNonQuery();
using (var connectionB = new SqliteConnection("Data Source=testdb;Mode=Memory;Cache=Shared")) {
connectionB.Open();
var cmd2 = connectionB.CreateCommand();
cmd2.CommandText = "select * from Person";
cmd2.ExecuteReader(); //high CPU until timeout
}
}
}
Expected result
Minimal CPU usage while waiting for table to unlock
100% CPU (on single core) usage while waiting for table to unlock during read.
Minimal repro steps
i.e.
Expected result
Minimal CPU usage while waiting for table to unlock
Actual result
Waiting takes all available CPU cycles
Further technical details
Missing a sleep in this loop ?
The text was updated successfully, but these errors were encountered: