Add a logging event when the context pooling maximum size is exceeded

Open
#24,817 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp

Research direction

Start by locating the EF Core context pooling implementation and existing logging events. Confirm how the maximum-size condition is detected and how one-time warnings are emitted; done means the condition produces a single configurable warning event, with behavior suitable for applications that choose to treat it as an exception.

Written by the indexing model from the issue text.

Description

area-dbcontext area-perf

As part of the Fortunes optimizations, it was discovered that our context pooling maximum size wasn't high enough (https://github.com/aspnet/Benchmarks/pull/1630). As suggested by @sebastienros, we should have a logging event for this - it's very easy to miss this (as we did) and think you're efficiently using context pooling, when in fact you're not.

IMHO it makes sense to fire this event only once, as a warning by default. Especially zealous applications (like our benchmarks) could configure this to throw an exception instead.

Dominant language
C#
Stars
14.8k
Forks
3.4k
Avg merge
2d 5h
Merged PRs (30d)
134

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/efcore

All issues in dotnet/efcore

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.