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

fix: use core pool size 1 for maintainer #3314

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,14 @@ public ReadOnlyTransaction readOnlyTransaction(TimestampBound bound) {

/**
* It is enough with one executor to maintain the multiplexed sessions in all the clients, as they
* do not need to be updated often, and the maintenance task is light.
* do not need to be updated often, and the maintenance task is light. The core pool size is set
* to 1 to prevent continuous creating and tearing down threads, and to avoid high CPU usage when
* running on Java 8 due to <a href="https://bugs.openjdk.org/browse/JDK-8129861">
* https://bugs.openjdk.org/browse/JDK-8129861</a>.
*/
private static final ScheduledExecutorService MAINTAINER_SERVICE =
Executors.newScheduledThreadPool(
/* corePoolSize = */ 0,
/* corePoolSize = */ 1,
ThreadFactoryUtil.createVirtualOrPlatformDaemonThreadFactory(
"multiplexed-session-maintainer", /* tryVirtual = */ false));

Expand Down
Loading