Skip to content

Conversation

@alex-clickhouse
Copy link
Collaborator

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adjusts the default PooledConnectionIdleTimeout from the system default (2 minutes on .NET Core) to 5 seconds for improved connection lifecycle management. The change introduces a new HttpHandlerProvider to centralize HTTP handler creation logic and enable platform-specific configuration.

Key changes:

  • Centralizes HTTP handler creation in a new HttpHandlerProvider class with conditional compilation for .NET Core 2.1+ vs. older frameworks
  • Sets PooledConnectionIdleTimeout = 5 seconds for SocketsHttpHandler on .NET Core 2.1+
  • Refactors SingleConnectionHttpClientFactory and DefaultPoolHttpClientFactory to use the new provider

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
ClickHouse.Driver/Http/HttpHandlerProvider.cs New static factory class that creates platform-appropriate HTTP handlers with 5-second idle timeout on .NET Core 2.1+
ClickHouse.Driver/Http/SingleConnectionHttpClientFactory.cs Refactored to use HttpHandlerProvider.CreateHandler() instead of directly instantiating DefaultHttpClientHandler
ClickHouse.Driver/Http/DefaultPoolHttpClientFactory.cs Refactored to use HttpHandlerProvider.CreateHandler() instead of directly instantiating DefaultHttpClientHandler

@codecov
Copy link

codecov bot commented Nov 18, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ClickHouse.Driver/Http/HttpHandlerProvider.cs 92.30% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@alex-clickhouse alex-clickhouse merged commit b5000ab into main Nov 18, 2025
21 of 31 checks passed
@alex-clickhouse alex-clickhouse deleted the default-idle-timeout branch November 18, 2025 14:49
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.

2 participants