Skip to content

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
@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.

3 participants