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

Lock initialization of AuroraHostListProvider #347

Merged
merged 5 commits into from
Feb 22, 2023

Conversation

aaron-congo
Copy link
Contributor

Addresses #343

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@@ -207,6 +215,7 @@ protected void init() throws SQLException {
}

this.isInitialized = true;
lock.unlock();
Copy link
Contributor

Choose a reason for hiding this comment

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

It might make sense to create a utility lock that implements Closable and then wrap this in try block, either way it should be in a try block with the unlock in a finally

: clusterRdsHostUrl;
this.isPrimaryClusterId = true;
try {
lock.lock();
Copy link
Contributor

Choose a reason for hiding this comment

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

Lock should be out of tr-finally block. We don't need to unlock if lock fails.

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.

4 participants