Skip to content

Conversation

olavloite
Copy link
Collaborator

The multiplexed session maintainer used a ScheduledExecutorService with a core pool size of zero. This can cause high CPU usage on Java 8 due to https://bugs.openjdk.org/browse/JDK-8129861. Also on higher versions of Java, it is better to use an executor with at least one core thread, instead of letting the executor create a new thread every time a task needs to be executed.

Fixes #3313
Fixes GoogleCloudPlatform/pgadapter#2249
Fixes googleapis/java-spanner-jdbc#1736

The multiplexed session maintainer used a ScheduledExecutorService
with a core pool size of zero. This can cause high CPU usage on
Java 8 due to https://bugs.openjdk.org/browse/JDK-8129861. Also
on higher versions of Java, it is better to use an executor with
at least one core thread, instead of letting the executor create
a new thread every time a task needs to be executed.

Fixes #3313
Fixes GoogleCloudPlatform/pgadapter#2249
Fixes googleapis/java-spanner-jdbc#1736
@olavloite olavloite requested a review from a team as a code owner August 30, 2024 06:25
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: spanner Issues related to the googleapis/java-spanner API. labels Aug 30, 2024
@olavloite olavloite requested a review from rahul2393 August 30, 2024 06:25
@olavloite olavloite added the automerge Merge the pull request once unit tests and other checks pass. label Aug 30, 2024
@gcf-merge-on-green gcf-merge-on-green bot merged commit cce008d into main Aug 30, 2024
32 of 33 checks passed
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Aug 30, 2024
@gcf-merge-on-green gcf-merge-on-green bot deleted the use-core-pool-size-1-for-mux-session-maintainer branch August 30, 2024 06:58
lqiu96 pushed a commit that referenced this pull request Sep 19, 2024
The multiplexed session maintainer used a ScheduledExecutorService with a core pool size of zero. This can cause high CPU usage on Java 8 due to https://bugs.openjdk.org/browse/JDK-8129861. Also on higher versions of Java, it is better to use an executor with at least one core thread, instead of letting the executor create a new thread every time a task needs to be executed.

Fixes #3313
Fixes https://togithub.com/GoogleCloudPlatform/pgadapter/issues/2249
Fixes https://togithub.com/googleapis/java-spanner-jdbc/issues/1736
lqiu96 pushed a commit that referenced this pull request Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. size: xs Pull request size is extra small.
Projects
None yet
2 participants