Repository navigation
Fix command disposal, parameter callbacks, handler-cache staleness, static properties, and type-map races - #2272
Merged
Merged
Conversation
…tatic properties, and type-map races Five small fixes, each identified by community PRs (credit: alaricd), re-tested on the repo's existing test infrastructure: - DbWrappedReader.DisposeAsync now disposes the wrapped command, mirroring the sync Dispose path; 'await using' on an ExecuteReaderAsync result previously leaked the command (#2185, community PR #2264) - QueryMultiple / QueryMultipleAsync now pass custom IParameterCallbacks implementations to the GridReader, not just DynamicParameters, so OnCompleted fires for them (#2179, community PR #2257, extended to the async call site) - AddTypeHandler purges compiled deserializer caches: a handler registered after a deserializer was compiled for a containing type is now honored (community PR #2247) - public static properties on parameter objects are ignored: the emitted IL loads the instance before each getter call, which is an invalid program for a static getter (community PR #2254) - AddTypeMap / RemoveTypeMap clone-and-swap now happens under a lock, so concurrent registrations cannot lose each other's updates (community PR #2251) Fixes #2179, fixes #2185
This was referenced Nov 20, 2026
This was referenced Nov 20, 2026
This was referenced Nov 21, 2026
Merged
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.
Five small production fixes, each originally identified in community PRs by @alaricd (#2264, #2257, #2247, #2254, #2251). The production changes are adopted essentially as proposed — with the parameter-callbacks fix extended to the async call site those PRs missed — and the tests are rewritten against the repo's existing test infrastructure (SQL Server provider pair, the in-repo mock reader, and the existing WrappedReader fakes) rather than introducing a new test dependency.
DbWrappedReader.DisposeAsyncnow disposes the wrapped command, mirroring the syncDisposepath;await usingon anExecuteReaderAsyncresult previously leaked the command until GC. Fixes Command not disposed with async using and ExecuteReaderAsync #2185. (from Dispose wrapped commands asynchronously #2264)QueryMultiple/QueryMultipleAsyncpass customIParameterCallbacksimplementations through to theGridReaderinstead of casting toDynamicParameters, soOnCompletedfires for them; the async call site inQueryMultipleAsynchad the same cast and is fixed too. Fixes Possible bug:GridReaderconstructor usesDynamicParameterscast instead ofIParameterCallbacks#2179. (from Support custom parameter callbacks in QueryMultiple #2257)AddTypeHandlerpurges the compiled deserializer caches. A handler changes the shape of the emitted IL, and the handled type can be a member of any materialized type, so deserializers compiled before registration silently ignored the handler forever. Static-init registrations skip the purge (caches necessarily empty). (from Fix stale deserializers after adding a type handler #2247)InvalidProgramExceptionon stored-proc calls or any SQL naming the property. (from Ignore static properties in parameter objects #2254)AddTypeMap/RemoveTypeMapclone-and-swap under a lock, matching the existingtypeHandlersSyncLockpattern, so concurrent registrations can no longer lose each other's updates. (from Make type map updates thread-safe #2251)Tests: 9 new (8 red on main, 1 sync-path guard), full suite 803 passed / 0 failed on net8.0 and net10.0 against real Postgres + SQL Server 2019 locally.