From 18e0834db8e81e9f2849d1ab3d6f4b5183af25b1 Mon Sep 17 00:00:00 2001 From: piexel Date: Thu, 15 Oct 2026 00:26:26 +0200 Subject: [PATCH] Stop a failed pregen instead of leaving it running An exception on the pregen thread ended the thread without shutting the job down, so it kept reporting 0 chunks per second forever and blocked starting another pregen. A failure is now logged and the job is closed. Model used: Claude Opus 5.5 --- .../core/pregenerator/IrisPregenerator.java | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/volmit/iris/core/pregenerator/IrisPregenerator.java b/core/src/main/java/com/volmit/iris/core/pregenerator/IrisPregenerator.java index e90307dc9..99fda1048 100644 --- a/core/src/main/java/com/volmit/iris/core/pregenerator/IrisPregenerator.java +++ b/core/src/main/java/com/volmit/iris/core/pregenerator/IrisPregenerator.java @@ -167,6 +167,26 @@ public class IrisPregenerator { } public void start() { + boolean completed = false; + try { + generateAll(); + completed = true; + } catch (Throwable e) { + Iris.reportError(e); + Iris.error("Pregen failed and is stopping: %s", e); + e.printStackTrace(); + } finally { + shutdown(); + } + + if (benchmarking == null) { + Iris.info(C.IRIS + "Pregen stopped."); + } else if (completed) { + benchmarking.finishedBenchmark(chunksPerSecondHistory); + } + } + + private void generateAll() { init(); ticker.start(); checkRegions(); @@ -174,12 +194,6 @@ public class IrisPregenerator { task.iterateRegions((x, z) -> visitRegion(x, z, true)); task.iterateRegions((x, z) -> visitRegion(x, z, false)); Iris.info("Pregen took " + Form.duration((long) p.getMilliseconds())); - shutdown(); - if (benchmarking == null) { - Iris.info(C.IRIS + "Pregen stopped."); - } else { - benchmarking.finishedBenchmark(chunksPerSecondHistory); - } } private void checkRegions() {