Skip to content

Make type map updates thread-safe - #2251

Open
alaricd wants to merge 2 commits into
DapperLib:mainfrom
pengdows:fix/issue-1439
Open

alaricd wants to merge 2 commits into
DapperLib:mainfrom
pengdows:fix/issue-1439

Conversation

@alaricd

@alaricd alaricd commented Oct 24, 2026

Copy link
Copy Markdown

Fixes #1439.

Concurrent AddTypeMap and RemoveTypeMap calls could take the same snapshot and overwrite each other. Serialize snapshot/mutate/replace operations and add a fakeDb-backed concurrent regression test.

alaricd and others added 2 commits October 24, 2026 07:42
Replace the Parallel.ForEach test with barrier-synchronised add/add and add/remove races that
fail reliably on the unlocked code. Mark the type-map snapshot field volatile.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

SqlMapper AddTypeMap/RemoveTypeMap not thread safe

1 participant