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

Use native connection checks where possible and with configurable timout #150

Merged
merged 1 commit into from
Oct 23, 2020

Conversation

hugomiguelabreu
Copy link
Contributor

@hugomiguelabreu hugomiguelabreu commented Oct 20, 2020

This commit introduces changes to the verification of the JDBC connections.
When verifying database connections, PDB should do it in a timely manner to allow a faster failover of the database. To achieve this goal, a new property is included to configure the timeout of the verification.
Most of the engines are now using JDBC standard isValid().
PostgreSQL, do not respect it and unit tests had failed consistently. (see: pgjdbc/pgjdbc#1943)
DB2 does not correctly recover connections using isValid().

@hugomiguelabreu hugomiguelabreu force-pushed the ft-ha-check-connection branch 2 times, most recently from bdd1c5b to 078f3ee Compare October 20, 2020 20:13
@hugomiguelabreu hugomiguelabreu changed the title Use JDBC specific isValid() to verify connections health checkConnection executes with a configurable timeout Oct 20, 2020
@hugomiguelabreu hugomiguelabreu changed the title checkConnection executes with a configurable timeout checkConnection() executes with a configurable timeout Oct 20, 2020
@hugomiguelabreu hugomiguelabreu changed the title checkConnection() executes with a configurable timeout checkConnection executes with a configurable timeout Oct 20, 2020
@hugomiguelabreu hugomiguelabreu self-assigned this Oct 20, 2020
@hugomiguelabreu hugomiguelabreu force-pushed the ft-ha-check-connection branch 3 times, most recently from b4599da to 9098fbd Compare October 21, 2020 09:13
@hugomiguelabreu
Copy link
Contributor Author

UT are all good to go.

@hugomiguelabreu hugomiguelabreu force-pushed the ft-ha-check-connection branch 2 times, most recently from 0781e1c to 7ec396d Compare October 21, 2020 16:29
Copy link
Collaborator

@artpdr artpdr left a comment

Choose a reason for hiding this comment

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

Nice job!

@hugomiguelabreu
Copy link
Contributor Author

hugomiguelabreu commented Oct 21, 2020

DB2 using isValid() isn't fully supported on PDB. I left the original implementation now with a timeout. This requires a re-review when possible @artpdr

@hugomiguelabreu hugomiguelabreu force-pushed the ft-ha-check-connection branch 2 times, most recently from e019069 to c619f44 Compare October 21, 2020 21:18
@hugomiguelabreu hugomiguelabreu force-pushed the ft-ha-check-connection branch 7 times, most recently from 6347ce7 to b2739d8 Compare October 22, 2020 17:28
Copy link
Member

@jmf-tls jmf-tls left a comment

Choose a reason for hiding this comment

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

looks great, only minor stuff to check

Copy link
Member

@jmf-tls jmf-tls left a comment

Choose a reason for hiding this comment

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

Please adjust the title and summary to what's currently being done

@hugomiguelabreu hugomiguelabreu changed the title checkConnection executes with a configurable timeout Use native connection checks where possible and with configurable timout Oct 23, 2020
@hugomiguelabreu hugomiguelabreu merged commit e6944a4 into master Oct 23, 2020
@hugomiguelabreu hugomiguelabreu deleted the ft-ha-check-connection branch October 23, 2020 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants