Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[release/8.0] Dispose related readers in GroupBySplitQueryingEnumerable (#36484)#36489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@roji
Copy link
Member

@rojiroji commentedAug 2, 2025
edited
Loading

Port of#36484 for EF 8.0.x.
Fixes#34280

Description
When a user executes a LINQ query that has a final GroupBy() (GroupBy as the very last operator), and executes as a split query, EF does not properly dispose the database reader(s) it uses to read back the results (these are IDisposable).

Customer impact
Depending on the provider, when executing a LINQ query that uses a final GroupBy() and is configured for split querying, the database connection may get leaked and never returned to the connection pool. This later leads to an exhausted connection pool and to an application failure in a way that's hard to track down and connect to the actual problematic EF LINQ query.

How found
Two users reported.

Regression
No - this bug was present when the final GroupBy feature was first introduced in EF 7.0 (in#19929)

Testing
Adding test coverage here is quite difficult/impractical - the bug is that a certain internal resource (DbDataReader) doesn't get disposed, which isn't something visible we can check.

Risk
Extremely low. The fix is very targeted and simply does the as for very similar other code (e.g. non-GroupBy SplitQueryingEnumerable).

@SamMonoRT
Copy link
Member

cc@artl93

@roji
Copy link
MemberAuthor

roji commentedAug 4, 2025

Approved via email.

@rojiroji merged commit08cefb3 intodotnet:release/8.0-stagingAug 4, 2025
7 checks passed
@rojiroji deleted the GroupBySplitDisposal8 branchAugust 4, 2025 22:24
This was referencedSep 9, 2025
This was referencedNov 24, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@AndriySvyrydAndriySvyrydAndriySvyryd approved these changes

@SamMonoRTSamMonoRTSamMonoRT approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@roji@SamMonoRT@AndriySvyryd

[8]ページ先頭

©2009-2025 Movatter.jp