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

Multiplexed session maintainer can cause high CPU load if used on Java 8 #3313

Closed
olavloite opened this issue Aug 30, 2024 · 0 comments · Fixed by #3314
Closed

Multiplexed session maintainer can cause high CPU load if used on Java 8 #3313

olavloite opened this issue Aug 30, 2024 · 0 comments · Fixed by #3314
Assignees
Labels
api: spanner Issues related to the googleapis/java-spanner API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@olavloite
Copy link
Collaborator

The multiplexed session maintainer uses a ScheduledExecutorService with a core pool size of 0. This can cause high CPU usage on Java 8: https://bugs.openjdk.org/browse/JDK-8129861

@olavloite olavloite added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels Aug 30, 2024
@olavloite olavloite self-assigned this Aug 30, 2024
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label Aug 30, 2024
olavloite added a commit that referenced this issue Aug 30, 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 GoogleCloudPlatform/pgadapter#2249
Fixes googleapis/java-spanner-jdbc#1736
lqiu96 pushed a commit that referenced this issue 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
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. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant