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

Random IndexOutOfBoundsException occurences #417

Closed
jebeaudet opened this issue Jun 16, 2023 · 5 comments
Closed

Random IndexOutOfBoundsException occurences #417

jebeaudet opened this issue Jun 16, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@jebeaudet
Copy link

Describe the bug

We're getting random IndexOutOfBoundsException exceptions.

Expected Behavior

The driver code should be safe from those exceptions.

Current Behavior

Stack trace :

java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 1
    at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
    at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
    at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
    at java.util.Objects.checkIndex(Objects.java:372)
    at java.util.ArrayList.get(ArrayList.java:459)
    at software.aws.rds.jdbc.mysql.shading.com.mysql.cj.jdbc.ha.plugins.failover.FailoverConnectionPlugin.updateHostIndex(FailoverConnectionPlugin.java:1292)
    at software.aws.rds.jdbc.mysql.shading.com.mysql.cj.jdbc.ha.plugins.failover.FailoverConnectionPlugin.updateTopologyIfNeeded(FailoverConnectionPlugin.java:737)
    at software.aws.rds.jdbc.mysql.shading.com.mysql.cj.jdbc.ha.plugins.failover.FailoverConnectionPlugin.execute(FailoverConnectionPlugin.java:274)
    at software.aws.rds.jdbc.mysql.shading.com.mysql.cj.jdbc.ha.plugins.ConnectionPluginManager.execute(ConnectionPluginManager.java:138)
    at software.aws.rds.jdbc.mysql.shading.com.mysql.cj.jdbc.ha.ConnectionProxy$JdbcInterfaceProxy.invoke(ConnectionProxy.java:345)
    at com.sun.proxy.$Proxy168.executeQuery
    at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)

Reproduction Steps

We're using Spring + Hibernate + Hikari FWIW. Unfortunately, I cannot provide a simple way to reproduce. During the bug, no failover or cluster change was happening, it just happened out of nowhere.

Possible Solution

No response

Additional Information/Context

No response

The AWS JDBC Driver for MySQL version used

1.1.7

JDK version used

11

Operating System and version

linux

@jebeaudet jebeaudet added the bug Something isn't working label Jun 16, 2023
@jebeaudet jebeaudet changed the title (short issue description) Random IndexOutOfBoundsException occurences Jun 16, 2023
@crystall-bitquill
Copy link
Collaborator

Hi @jebeaudet,

Thanks for raising this issue.

We'll take a look at this and keep you updated as we investigate.

In the meantime, could you please provide some additional details regarding the following?

  • What does the connection URL look like, and what connection parameters are being used?
  • What does the Hikari configuration look like?
  • Cluster structure: How many database nodes are there?
  • Driver logs, which can be enabled as seen here.

Thank you for your patience!

@jebeaudet
Copy link
Author

What does the connection URL look like, and what connection parameters are being used?

jdbc:mysql:aws://CLUSTER_ID.cluster-RANDOM_STRING.us-east-1.rds.amazonaws.com:3306/DATABASE?autoReconnect=true&rewriteBatchedStatements=true&socketTimeout=60000

What does the Hikari configuration look like?

    hikari:
      maxLifetime: 600000
      maximumPoolSize: 50
      minimumIdle: 10
      idleTimeout: 300000
      connectionTimeout: 5000
      validationTimeout: 2000

The rest of the parameters are Spring's defaults.

Cluster structure: How many database nodes are there?

It's a regional cluster with only 1 primary with version 5.7.mysql_aurora.2.11.1.

Driver logs, which can be enabled as seen here.

It's was really a one of.

@karenc-bq
Copy link
Contributor

Hi @jebeaudet, we merged a PR #420 addressing this issue, could you please kindly check out the snapshot build and let us know if the issue persists? Thank you.

@jebeaudet
Copy link
Author

Hi @karenc-bq

Thanks for the quick fix! It's a bit hard for me to test snapshots but we're eager to bump released versions, I'll circle back here if it ever pops up again when this fix lands the next released version.

Thanks again!

@karenc-bq
Copy link
Contributor

Hi @jebeaudet, we released a new version containing this fix. We will be closing this issue now, please don't hesitate to reach out again if the issue persists. Thank you again for raising this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants