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

added settings for AHC to validate when stale #1722

Merged
merged 1 commit into from
Jul 7, 2024

Conversation

chernser
Copy link
Contributor

@chernser chernser commented Jul 6, 2024

Summary

Apache HC has a great feature of checking for stale connection. Once this feature has been added to the our client but disappeared after some time due to refactoring (unfortunately it happens).
Here is original PR #760

New http client option is added to the com.clickhouse.client.http.config.ClickHouseHttpOption

    /**
     * The time in milliseconds after which the connection is validated after inactivity.
     * Default value is 5000 ms. If set to negative value, the connection is never validated.
     * It is used only for Apache Http Client connection provider.
     */
    AHC_VALIDATE_AFTER_INACTIVITY("ahc_validate_after_inactivity", 5000L,
            "The time in milliseconds after which the connection is validated after inactivity."),

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG

@chernser chernser requested review from Paultagoras and mzitnik July 6, 2024 07:36
Copy link
Contributor

@mzitnik mzitnik left a comment

Choose a reason for hiding this comment

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

Have you managed to reproduce it? Do you know how it works under the hood?

@chernser
Copy link
Contributor Author

chernser commented Jul 7, 2024

Have you managed to reproduce it? Do you know how it works under the hood?

Yes and no, I can reproduce same exception with wiremock but it is not a vanilla case. I mean it is not a 100% stale connection.

@chernser chernser merged commit 3abc5d6 into main Jul 7, 2024
58 checks passed
@chernser chernser deleted the feat_check_connection_before_use branch July 7, 2024 17:22
@chernser chernser added this to the 0.6.3 Release milestone Jul 15, 2024
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