A PageFileConfig built with an object initializer gets LockTimeout.Immediate: every lock fails at once under contention
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with PageFileConfig.Normalize() and the LockTimeout type and property; the issue names no source or test files, so first locate those definitions and the tests for partial configs and concurrent inserts. Compare an object-initialized config with PageFileConfig.Default under the reported workload. Done when an unset timeout uses the intended default, explicit Immediate remains usable, and the contention case no longer fails as reported.
Written by the indexing model from the issue text.
Description
What happens
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.LockTimeoutsays it defaults toLockTimeout.Default. That is true only for the presets (Small,Default,Large,Server,DetectFromFile). Normalize()says it makes "a partially-constructedPageFileConfig... always valid", and its example config gets fail-fast locks.- It is the strongest form of #303: a healthy database that rejects most concurrent writes.
Possible fixes
- Give
LockTimeouta hidden "was set" flag (set byImmediate,Default,Fromand theinitaccessors), and haveNormalize()replace an unset value withLockTimeout.Default. Equality stays on the three values. - Or make
Immediatedistinguishable fromdefaultsome other way, and document thatdefault(LockTimeout)means "use the default". - At minimum, correct the two doc comments so they say that an initializer without
LockTimeoutgetsImmediate.
Connected
- #303 / PR #321:
LockTimeout.Default500 ms → 5 s. #321 does not change this case: a partial config still gets 0 ms. - #288 (reliability epic).
- Dominant language
- C#
- Stars
- 66
- Forks
- 6
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 58
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EntglDb/BLite
-
GdprMode.Strict warns that deleted documents are not zeroed, but every delete zero-fills themPossibly taken @CaffeinatedCoder claimed this 1 day ago. Openbug gdpr package/core severity/low
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
EntglDb/BLite#299 · 1 comment ·
Maintainers usually reply within 2 days
-
bug package/core severity/medium triage
Difficulty 4/5 3-5 days Newbie friendliness 54/100
Maintainers usually reply within 2 days
-
enhancement package/core
Difficulty 4/5 3-5 days Newbie friendliness 48/100
EntglDb/BLite#320 · 1 comment ·
Maintainers usually reply within 2 days
-
BLiteSession.Rollback() does not await the rollback: it returns while the transaction is still active, and failures go unobservedPossibly taken @CaffeinatedCoder claimed this 1 day ago. Openbug package/core severity/medium
Difficulty 3/5 1-2 days Newbie friendliness 78/100
EntglDb/BLite#307 · 1 comment ·
Maintainers usually reply within 2 days
-
area/indexing bug package/core severity/medium
Difficulty 4/5 3-5 days Newbie friendliness 55/100
EntglDb/BLite#305 · 1 comment ·
Maintainers usually reply within 2 days
Similar issues
-
status:waiting-for-triage type:bug
Difficulty 1/5 Under an hour Newbie friendliness 84/100
microsoftgraph/msgraph-sdk-dotnet#3194 ·
Maintainers usually reply within 1 day
-
Backend enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
UI: money shows the minus sign next to the number, not before the currency (IL -3.0m, not -IL 3.0m)Openarea: sim area: unity enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eyalgolan/statecraft-israel#1107 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
dimitar-radenkov/Pointframe#271 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
qew21/Genshin-Subtitles#45 ·