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

fix: handle the case when this.currentHostIndex is an invalid index #420

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

karenc-bq
Copy link
Contributor

@karenc-bq karenc-bq commented Jun 20, 2023

Summary

updateHostIndex may throw an IndexOutOfBoundException if this.currentHostIndex is -1.
Addresses sissue #417

Description

Additional Reviewers

@karenc-bq karenc-bq self-assigned this Jun 20, 2023
@@ -1264,6 +1264,11 @@ private void updateCurrentConnection(
}

private void updateHostIndex(List<HostInfo> latestTopology) throws SQLException {
if (this.currentHostIndex == NO_CONNECTION_INDEX) {
Copy link
Contributor

Choose a reason for hiding this comment

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

HostInfo currentHost = this.currentHostIndex == NO_CONNECTION_INDEX ? null : this.hosts.get(this.currentHostIndex);

?

@karenc-bq karenc-bq merged commit e71f7ef into awslabs:main Jun 20, 2023
1 check passed
@karenc-bq karenc-bq deleted the index_out_of_bound branch June 20, 2023 21:05
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.

None yet

3 participants