Skip to content

Commit

Permalink
[fix](stats) keep threads in pool alive to maintain reasonable parall…
Browse files Browse the repository at this point in the history
…elism (#30451)
  • Loading branch information
freemandealer authored Feb 4, 2024
1 parent bd079db commit 1e3af61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class ThreadPoolManager {

private static String[] poolMetricTypes = {"pool_size", "active_thread_num", "task_in_queue"};

private static final long KEEP_ALIVE_TIME = 60L;
public static final long KEEP_ALIVE_TIME = 60L;

public static void registerAllThreadPoolMetric() {
for (Map.Entry<String, ThreadPoolExecutor> entry : nameToThreadPoolMap.entrySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.apache.doris.common.DdlException;
import org.apache.doris.common.FeConstants;
import org.apache.doris.common.FeMetaVersion;
import org.apache.doris.common.ThreadPoolManager;
import org.apache.doris.common.ThreadPoolManager.BlockedPolicy;
import org.apache.doris.common.io.Text;
import org.apache.doris.common.io.Writable;
Expand Down Expand Up @@ -645,7 +646,8 @@ private ThreadPoolExecutor createThreadPoolForSyncAnalyze() {
String poolName = "SYNC ANALYZE THREAD POOL";
return new ThreadPoolExecutor(0,
ConnectContext.get().getSessionVariable().parallelSyncAnalyzeTaskNum,
0, TimeUnit.SECONDS,
ThreadPoolManager.KEEP_ALIVE_TIME,
TimeUnit.SECONDS,
new LinkedBlockingQueue<>(),
new ThreadFactoryBuilder().setDaemon(true).setNameFormat("SYNC ANALYZE" + "-%d")
.build(), new BlockedPolicy(poolName,
Expand Down

0 comments on commit 1e3af61

Please sign in to comment.