Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in-house connection pooling #236

Open
DarkWanderer opened this issue Nov 22, 2022 · 4 comments
Open

Add in-house connection pooling #236

DarkWanderer opened this issue Nov 22, 2022 · 4 comments
Assignees

Comments

@DarkWanderer
Copy link
Owner

No description provided.

@DarkWanderer DarkWanderer self-assigned this Nov 22, 2022
@AlirezaEiji191379
Copy link

hi @DarkWanderer
do you need this feature? if you need it i want to implement it

@DarkWanderer
Copy link
Owner Author

Hi. Thanks for your suggestion - I will be interested in contributions

@smbecker
Copy link
Contributor

Isn't this possible today with a single ClickHouseConnection and the existing connection pooling provided by HttpClient?

@DarkWanderer
Copy link
Owner Author

DarkWanderer commented Dec 6, 2024

This is currently the default mode of operation.

The issue with this, unfortunately, is that .NET HTTP connection pooling is not well-compatible with ClickHouse session implementation. Specifically, ClickHouse sometimes - rarely - freaks out if there is still an open HTTP connection where a session has been used, and same session ID is then used from different HTTP connection. See #152

Current way to solve this issue is to create and own a HttpClientHandler with a single owned HTTP stream for each ClickHouseConnection - thus behaving more similarly to traditional SQL connectors. With that in mind, I wanted to complete the analogy and add "Pooling" parameters to connection string similar to how MySQL or Postgres libraries behave

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

No branches or pull requests

3 participants