You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 963af37
Browse filesBrowse the repository at this point in the historyBrowse files
feat(p1a): recognise ADO.NET owned-returning members (ExecuteReader/CreateCommand/BeginTransaction)
P1a ADO.NET tranche — the single most common real-world .NET resource leak: a
DbDataReader from `cmd.ExecuteReader()` (or a DbCommand from `CreateCommand()`,
a DbTransaction from `BeginTransaction()`) dropped without Dispose holds the
reader / command / server-side cursor open until finalization.
These are INSTANCE methods on a connection/command, unlike the existing static
File/crypto/Xml/Json factories — but the acquire path (op="acquire") is
static-vs-instance agnostic and the receiver is not an argument, so nothing is
dropped (spike-confirmed). Recognise them in `IsOwningFactory` by method name +
the RESOLVED return type implementing the System.Data contract interface
(IDataReader / IDbCommand / IDbTransaction), which is provider-agnostic: it
covers every concrete provider (SqlDataReader, NpgsqlDataReader, …), the abstract
base (DbDataReader/DbCommand/DbTransaction), and the interface itself. Guarded by
!AnyDisposableArgument (args are CommandBehavior/IsolationLevel enums anyway).
Corpus fixture `ado-executereader-leak`: before.cs leaks the reader (OWN001),
after.cs disposes it with `using` (clean), case.own reduces the pattern.
Locally verified: case.own → OWN001 (test_corpus 21/21), full suite green, mypy
--strict, ruff. The C# extractor branch and the before.cs/after.cs end-to-end run
are verified by CI (no dotnet locally): golden C# compiles, C# leak extractor,
and the corpus benchmark (before caught + after clean, no specificity regression).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019846YSZ35c7CdkWQ1qX5gm
0 commit comments