Skip to content

ClusterTopologyMonitorImpl leaks threads #1321

@vvitiesc

Description

@vvitiesc

Describe the bug

`"Thread-75817-nm" #271317 daemon prio=5 os_prio=0 cpu=2817.92ms elapsed=1082.59s tid=0x00007fbb144d4000 nid=0x1ff7 sleeping [0x00007fb7e2463000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(java.base@11.0.18/Native Method)
at java.lang.Thread.sleep(java.base@11.0.18/Thread.java:334)
at java.util.concurrent.TimeUnit.sleep(java.base@11.0.18/TimeUnit.java:446)
at software.amazon.jdbc.hostlistprovider.monitoring.ClusterTopologyMonitorImpl$NodeMonitoringThread.run(ClusterTopologyMonitorImpl.java:842)

"Thread-75819-nm" #271429 daemon prio=5 os_prio=0 cpu=2663.22ms elapsed=998.01s tid=0x00007fbad4176800 nid=0x2079 sleeping [0x00007fb7c89ca000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(java.base@11.0.18/Native Method)
at java.lang.Thread.sleep(java.base@11.0.18/Thread.java:334)
at java.util.concurrent.TimeUnit.sleep(java.base@11.0.18/TimeUnit.java:446)
at software.amazon.jdbc.hostlistprovider.monitoring.ClusterTopologyMonitorImpl$NodeMonitoringThread.run(ClusterTopologyMonitorImpl.java:842)

"Thread-75820-nm" #271430 daemon prio=5 os_prio=0 cpu=2662.86ms elapsed=997.99s tid=0x00007fbad4177000 nid=0x207a sleeping [0x00007fb7c4182000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(java.base@11.0.18/Native Method)
at java.lang.Thread.sleep(java.base@11.0.18/Thread.java:334)
at java.util.concurrent.TimeUnit.sleep(java.base@11.0.18/TimeUnit.java:446)
at software.amazon.jdbc.hostlistprovider.monitoring.ClusterTopologyMonitorImpl$NodeMonitoringThread.run(ClusterTopologyMonitorImpl.java:842)

"Thread-75822-nm" #271436 daemon prio=5 os_prio=0 cpu=2553.69ms elapsed=986.91s tid=0x00007fbaf841e000 nid=0x2080 sleeping [0x00007fb7c4a8b000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(java.base@11.0.18/Native Method)
at java.lang.Thread.sleep(java.base@11.0.18/Thread.java:334)
at java.util.concurrent.TimeUnit.sleep(java.base@11.0.18/TimeUnit.java:446)
at software.amazon.jdbc.hostlistprovider.monitoring.ClusterTopologyMonitorImpl$NodeMonitoringThread.run(ClusterTopologyMonitorImpl.java:842)`

after 4 days of loadtesting the JVM using aws-advanced-jdbc-wrapper had 5690 NodeMonitoringThreads in TIMED_WAITING state

Expected Behavior

Expecting the wrapper to not to leak threads

What plugins are used? What other connection properties were set?

failover2,efm2,auroraConnectionTracker, connection params: cachePrepStmts=true&useServerPrepStmts=false&prepStmtCacheSize=1000&useUnicode=true&characterEncoding=UTF-8&connectTimeout=60000&socketTimeout=360000&initializationFailTimeout=30000&maxLifeTime=500000&idleTimeout=300000&useSSL=false

Current Behavior

was loadtesting our software and tests failed due to the new version using considerably more resources that the reference test with same load.

Reproduction Steps

can reproduce this using our app, cannot provide code

Possible Solution

No response

Additional Information/Context

No response

The AWS Advanced JDBC Driver version used

2.5.4

JDK version used

openjdk version "11.0.18" 2023-01-17 LTS OpenJDK Runtime Environment Corretto-11.0.18.10.1 (build 11.0.18+10-LTS) OpenJDK 64-Bit Server VM Corretto-11.0.18.10.1 (build 11.0.18+10-LTS, mixed mode)

Operating System and version

4.14.305-227.531.amzn2.x86_64 #1 SMP Tue Feb 14 09:55:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions