-
Notifications
You must be signed in to change notification settings - Fork 800
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 ClickHouse HealthCheck support #2315
base: master
Are you sure you want to change the base?
Conversation
b7411b3
to
cb89eac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smbecker big thanks for your contribution! It looks like a step in the right direction, we just need to clarify how ClickHouseConnection
should be used to ensure we provide the right API and of course solve the copy-paste errors.
{ | ||
try | ||
{ | ||
await using var connection = _options.ConnectionFactory?.Invoke() ?? new ClickHouseConnection(_options.ConnectionString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the recommendations for using ClickHouseConnection
? Namely:
- is it thread safe?
- does it have a built-in pool of connections? (when we execute
new ClickHouseConnection(_options.ConnectionString)
, does it always create a new coonection?)
I need to get a better understanding of how it should be used before I approve the shape of the public API for this DB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it thread safe?
Looking at the code, instance methods on ClickHouseConnection
do not appear to be thread-safe. However, commands do appear to be thread-safe in that they just execute HttpRequestMessages
against the owned HttpClient
.
does it have a built-in pool of connections?
It does not support pooling directly. However, when creating a ClickHouseConnection
with a passed in HttpClient
or IHttpClientFactory
, you can take advantage of pooling within the HttpClient.
I could follow a similar pattern to Npgsql
if/when this PR is merged.
What this PR does / why we need it: Adds health check support for ClickHouse
Does this PR introduce a user-facing change?: It adds a new package to support ClickHouse health checks
Please make sure you've completed the relevant tasks for this PR, out of the following list: