Skip to content

Clarify HttpClient connection-pool disposal - #55318

Merged
adegeo merged 4 commits into
mainfrom
copilot/fix-misleading-instruction
Aug 5, 2026
Merged

Clarify HttpClient connection-pool disposal#55318
adegeo merged 4 commits into
mainfrom
copilot/fix-misleading-instruction

Conversation

Copilot AI commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

HttpClient disposal doesn't always dispose pooled connections. The outcome depends on whether the client owns its underlying handler.

  • Connection pool ownership

    • Clarify that disposing an HttpClient disposes pooled connections only when it also disposes its handler.
    • State that clients using externally managed handlers leave the handler and connections intact when disposed.
  • Factory-managed clients

    • Explain that IHttpClientFactory manages and reuses handlers and their connection pools.
    • Clarify that a new connection is required only after the handler is eventually disposed.

Internal previews

File Preview link
docs/fundamentals/networking/http/httpclient-guidelines.md docs/fundamentals/networking/http/httpclient-guidelines

Copilot AI review requested due to automatic review settings August 5, 2026 22:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Copilot AI linked an issue Aug 5, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits August 5, 2026 22:03
Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix misleading instruction about HttpClient disposal Clarify HttpClient connection-pool disposal Aug 5, 2026
Copilot AI requested a review from adegeo August 5, 2026 22:04
@adegeo
adegeo marked this pull request as ready for review August 5, 2026 22:19
@adegeo
adegeo requested a review from a team as a code owner August 5, 2026 22:19
@gewarren
gewarren requested a review from a team August 5, 2026 22:32

@MihaZupan MihaZupan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Comment thread docs/fundamentals/networking/http/httpclient-guidelines.md Outdated
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
@adegeo
adegeo enabled auto-merge (squash) August 5, 2026 23:26
@adegeo
adegeo merged commit a34f5ed into main Aug 5, 2026
12 checks passed
@adegeo
adegeo deleted the copilot/fix-misleading-instruction branch August 5, 2026 23:46
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.

Misleading instruction

4 participants