Skip to content

The Finalizer thread occasionally consumes 100% of a single core #1390

@CokkkeZ

Description

@CokkkeZ

Describe the bug

The ConnectionWrapper.finalize occasionally causes one CPU core to spike to 100% for a few minutes.

Expected Behavior

Expect ConnectionWrapper.finalize won't cause any cpu spikes

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

failover2,efm2,auroraConnectionTracker

Current Behavior

Here is the stacktrace of the Finalizer thread:

"Finalizer" #3 daemon prio=8 os_prio=0 cpu=7887916.39ms elapsed=207053.18s tid=0x00007f92c9442800 nid=0xd7a runnable [0x00007f9274155000] java.lang.Thread.State: RUNNABLE at software.amazon.jdbc.plugin.OpenedConnectionTracker.lambda$null$10(OpenedConnectionTracker.java:207) at software.amazon.jdbc.plugin.OpenedConnectionTracker$$Lambda$1325/0x0000000800b50c40.test(Unknown Source) at java.util.concurrent.ConcurrentLinkedQueue.bulkRemove([email protected]/ConcurrentLinkedQueue.java:1004) at java.util.concurrent.ConcurrentLinkedQueue.removeIf([email protected]/ConcurrentLinkedQueue.java:964) at software.amazon.jdbc.plugin.OpenedConnectionTracker.lambda$pruneNullConnections$11(OpenedConnectionTracker.java:202) at software.amazon.jdbc.plugin.OpenedConnectionTracker$$Lambda$1324/0x0000000800b50840.accept(Unknown Source) at java.util.concurrent.ConcurrentHashMap.forEach([email protected]/ConcurrentHashMap.java:1603) at software.amazon.jdbc.plugin.OpenedConnectionTracker.pruneNullConnections(OpenedConnectionTracker.java:201) at software.amazon.jdbc.plugin.AuroraConnectionTrackerPlugin.releaseResources(AuroraConnectionTrackerPlugin.java:176) at software.amazon.jdbc.ConnectionPluginManager.lambda$releaseResources$15(ConnectionPluginManager.java:588) at software.amazon.jdbc.ConnectionPluginManager$$Lambda$1323/0x0000000800b50440.accept(Unknown Source) at java.util.ArrayList.forEach([email protected]/ArrayList.java:1541) at software.amazon.jdbc.ConnectionPluginManager.releaseResources(ConnectionPluginManager.java:585) at software.amazon.jdbc.wrapper.ConnectionWrapper.releaseResources(ConnectionWrapper.java:174) at software.amazon.jdbc.wrapper.ConnectionWrapper.finalize(ConnectionWrapper.java:957) at java.lang.System$2.invokeFinalize([email protected]/System.java:2125) at java.lang.ref.Finalizer.runFinalizer([email protected]/Finalizer.java:87) at java.lang.ref.Finalizer$FinalizerThread.run([email protected]/Finalizer.java:171)

Reproduction Steps

Not clear

Possible Solution

No response

Additional Information/Context

No response

The AWS Advanced JDBC Driver version used

2.5.4

JDK version used

11

Operating System and version

linux 4.14.256

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpending releaseResolution implemented, pending official release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions