Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

fix: use core pool size 1 for maintainer#3314

Merged
gcf-merge-on-green[bot] merged 1 commit intomainfrom
use-core-pool-size-1-for-mux-session-maintainer
Aug 30, 2024
Merged

fix: use core pool size 1 for maintainer#3314
gcf-merge-on-green[bot] merged 1 commit intomainfrom
use-core-pool-size-1-for-mux-session-maintainer

Conversation

@olavloite
Copy link
Copy Markdown
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 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
@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spanner Issues related to the googleapis/java-spanner API. size: xs Pull request size is extra small.

Projects

None yet

2 participants