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 }}
Repository navigation
A PageFileConfig built with an object initializer gets LockTimeout.Immediate: every lock fails at once under contention #322
A PageFileConfig built with an object initializer, for example new PageFileConfig { AllowMultiProcessAccess = true } (the pattern the Normalize() doc comment uses as its example), opens with LockTimeout(Read=0ms, Write=0ms, MaxWriters=0), which is LockTimeout.Immediate. Every lock then fails at once under any contention.
Normalize() fills in PageSize and GrowthBlockSize from Default, but not LockTimeout. default(LockTimeout) has the same value as LockTimeout.Immediate, so the engine cannot tell "not set" from "fail fast on purpose".
Measured on main (0450b97): new BLiteEngine(path, new PageFileConfig { AllowMultiProcessAccess = false }), then 4 tasks × 50 auto-committing InsertAsync on one collection: 150 of 200 inserts throw TimeoutException. The same workload with PageFileConfig.Default throws none.
Why it matters
The doc comment on PageFileConfig.LockTimeout says it defaults to LockTimeout.Default. That is true only for the presets (Small, Default, Large, Server, DetectFromFile).
Normalize() says it makes "a partially-constructed PageFileConfig ... always valid", and its example config gets fail-fast locks.
Give LockTimeout a hidden "was set" flag (set by Immediate, Default, From and the init accessors), and have Normalize() replace an unset value with LockTimeout.Default. Equality stays on the three values.
Or make Immediate distinguishable from default some other way, and document that default(LockTimeout) means "use the default".
At minimum, correct the two doc comments so they say that an initializer without LockTimeout gets Immediate.
Reproduced on 0450b97: 150 of 200 concurrent inserts time out with an object-initializer config, because Normalize() leaves LockTimeout at default(LockTimeout) (= Immediate). Medium; workaround: start from a preset with with.
Activity
mrdevrobot commentedon Oct 18, 2026
Reproduced on 0450b97: 150 of 200 concurrent inserts time out with an object-initializer config, because Normalize() leaves LockTimeout at default(LockTimeout) (= Immediate). Medium; workaround: start from a preset with
with.