Fix incorrect error handling in off-main chunk load task

Now that there is no on-main task, the completion logic
for the status task is completed with the results passed
by the off-main task. Thus, the chunk system saw a non-null
throwable and assumed a fatal crash. The old on-main task
did not pass the throwable through in this case, which allowed
the chunk to re-generate.

Fixes https://github.com/PaperMC/Folia/issues/7
This commit is contained in:
Spottedleaf 2023-03-29 17:08:56 -07:00
parent 749480c7ec
commit f34a20c36a

View File

@ -70,7 +70,7 @@ index fb42d776f15f735fb59e972e00e2b512c23a8387..300700477ee34bc22b31315825c0e40f
chunk = wrappedFull.getWrapped(); chunk = wrappedFull.getWrapped();
} else { } else {
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkLoadTask.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkLoadTask.java diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkLoadTask.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkLoadTask.java
index be6f3f6a57668a9bd50d0ea5f2dd2335355b69d6..d52f68d0302d581b9bbe30fe0680fb8108e3da85 100644 index be6f3f6a57668a9bd50d0ea5f2dd2335355b69d6..1f7c146ff0b2a835c818f49da6c1f1411f26aa39 100644
--- a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkLoadTask.java --- a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkLoadTask.java
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkLoadTask.java +++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkLoadTask.java
@@ -25,6 +25,7 @@ import org.slf4j.Logger; @@ -25,6 +25,7 @@ import org.slf4j.Logger;
@ -265,7 +265,7 @@ index be6f3f6a57668a9bd50d0ea5f2dd2335355b69d6..d52f68d0302d581b9bbe30fe0680fb81
} catch (final Throwable thr2) { } catch (final Throwable thr2) {
LOGGER.error("Failed to parse chunk data for task: " + this.toString() + ", chunk data will be lost", thr2); LOGGER.error("Failed to parse chunk data for task: " + this.toString() + ", chunk data will be lost", thr2);
- return new TaskResult<>(null, thr2); - return new TaskResult<>(null, thr2);
+ return new TaskResult<>(this.getEmptyChunk(), thr2); + return new TaskResult<>(this.getEmptyChunk(), null);
} }
} }