Repository navigation
Conversation
Avoid waiting for the LMDB writer when reading records without a caller-supplied transaction. Cover writer contention and lazy table initialization with real LMDB tests.
bu5hm4nn
marked this pull request as draft
December 3, 2026 17:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scrolling the feed could stall while the UI thread waited for LMDB’s writer lock. Hovering an unread note also wrote its viewed state directly from the UI. Both paths worked against Keeping the UI responsive.
Send viewed-state updates through the existing Overlord inbox and batch the writes off-thread. Make
Table::read_recordopen a read-only transaction when the caller doesn’t supply one, so routine lookups don’t acquire the writer lock.Real LMDB regression tests cover writer contention and lazy table initialization. A live scroll sample went from 716 of 2,772 main-thread samples waiting on the writer lock to none in the follow-up capture. The PR branch passes
cargo check; the full test rerun on the new base did not complete within the allotted time.