From f0d71027f11bcbb5d435786cfae8e92c7b573632 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 9 Feb 2026 07:43:53 -0600 Subject: [PATCH] Fix loosing some thread pool tasks --- .../core/util/threading/PriorityTaskPicker.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/util/threading/PriorityTaskPicker.java b/core/src/main/java/com/seibel/distanthorizons/core/util/threading/PriorityTaskPicker.java index 42bec450b..f1fa01e2e 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/util/threading/PriorityTaskPicker.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/util/threading/PriorityTaskPicker.java @@ -133,6 +133,15 @@ public class PriorityTaskPicker // Clear this executor's tasks since we no longer expect anything to execute. executor.taskQueue.clear(); } + else + { + // This executor is still running, there must have been a glitch with the + // underlying thread pool. + // Re-queue the task so we don't lose any tasks + // (failing to re-queue tasks can cause LODs to fail to load due + // to completable futures becoming orphaned). + executor.taskQueue.add(task); + } } } }