jt2594838 commented on code in PR #18712:
URL: https://github.com/apache/iotdb/pull/18712#discussion_r4089959722
##########
iotdb-client/subscription/src/main/java/org/apache/iotdb/session/subscription/consumer/base/SubscriptionExecutorServiceManager.java:
##########
@@ -65,6 +66,33 @@ public final class SubscriptionExecutorServiceManager {
DOWNSTREAM_DATA_FLOW_EXECUTOR_NAME,
Math.max(Runtime.getRuntime().availableProcessors(), 1));
+ /** Heartbeat Executor: isolate a slow provider from the heartbeat
control-flow scheduler. */
+ private static final SubscriptionExecutorService HEARTBEAT_EXECUTOR =
+ new SubscriptionExecutorService(HEARTBEAT_EXECUTOR_NAME, 0) {
+ @Override
+ void launchIfNeeded() {
+ if (isShutdown()) {
+ synchronized (this) {
+ if (isShutdown()) {
+ LOGGER.info(SubscriptionMessages.EXECUTOR_LAUNCHING,
this.name, this.corePoolSize);
+ this.executor =
+ Executors.newCachedThreadPool(
+ r -> {
+ final Thread t =
+ new Thread(
+ Thread.currentThread().getThreadGroup(),
+ r,
+ HEARTBEAT_EXECUTOR_NAME,
+ 0);
+ t.setDaemon(true);
+ return t;
+ });
+ }
Review Comment:
Use IoTDBThreadPoolFactor and ThreadName.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]