From e1462a925344bc038818dd88871af0139ee35958 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Fri, 26 Jul 2024 13:43:48 +0100 Subject: [PATCH] Bump MCUtils#asyncExecutor core size Long ago we discovered that the default thread pools would not increase the number of threads running the pool until queue addition failed. Bumping the core size mitigates an issue with spark-paper, and in general, keeping async threads around generally beats having to spin new ones everytime we want to execute a periodic async task. --- patches/server/0009-MC-Utils.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/0009-MC-Utils.patch b/patches/server/0009-MC-Utils.patch index bb4e8413c9..a27ab77534 100644 --- a/patches/server/0009-MC-Utils.patch +++ b/patches/server/0009-MC-Utils.patch @@ -4077,7 +4077,7 @@ index 0000000000000000000000000000000000000000..197224e31175252d8438a8df585bbb65 +} diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java new file mode 100644 -index 0000000000000000000000000000000000000000..c9bebadaf4be03cc92774b7367aeecdd380046f1 +index 0000000000000000000000000000000000000000..0449d4619e3a0752dea0981fb149542e23076c52 --- /dev/null +++ b/src/main/java/io/papermc/paper/util/MCUtil.java @@ -0,0 +1,176 @@ @@ -4114,7 +4114,7 @@ index 0000000000000000000000000000000000000000..c9bebadaf4be03cc92774b7367aeecdd + } + }; + public static final ThreadPoolExecutor asyncExecutor = new ThreadPoolExecutor( -+ 0, 2, 60L, TimeUnit.SECONDS, ++ 2, 2, 60L, TimeUnit.SECONDS, + new LinkedBlockingQueue<>(), + new ThreadFactoryBuilder() + .setNameFormat("Paper Async Task Handler Thread - %1$d")