Skip to content

Remove inaccurate @NotThreadSafe from InMemoryMap.MemoryDataSource - #6522

Merged
DomGarguilo merged 1 commit into
apache:2.1from
DomGarguilo:memDataSourceThreadSafety
Aug 31, 2026
Merged

Remove inaccurate @NotThreadSafe from InMemoryMap.MemoryDataSource#6522
DomGarguilo merged 1 commit into
apache:2.1from
DomGarguilo:memDataSourceThreadSafety

Conversation

@DomGarguilo

Copy link
Copy Markdown
Member

fixes #6093

InMemoryMap.MemoryDataSource was marked with @NotThreadSafe but was actually accessed by multiple threads meaning that annotation is inaccurate.

Three threads can reach a single instance:

  • a scan thread via SourceSwitchingIterator.seek() and next()
  • the minor compaction thread via InMemoryMap.delete()
  • the closing thread in MemoryIterator.close()

All external callers are synchronized so its safe regardless. This means removing the annotation is the right move here.

@ddanielr ddanielr added this to the 2.1.7 milestone Aug 31, 2026
@DomGarguilo
DomGarguilo merged commit c186563 into apache:2.1 Aug 31, 2026
9 checks passed
@DomGarguilo DomGarguilo linked an issue Sep 1, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Analyze thread safety of InMemoryMap.MemoryDataSource

2 participants