From 34ea199fb0da75890930f019d28dc78dc2b0e26a Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 2 Nov 2021 14:30:23 +0000 Subject: [PATCH] World: fixed additional edge case - population promise rejected before task completion if this happened, the index would stay set in activeChunkPopulationTasks, eventually causing the generation queue to jam up completely and non-forced generation to come to a standstill. --- src/world/World.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/world/World.php b/src/world/World.php index 3725da08e..cb4039b89 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -2918,7 +2918,11 @@ class World implements ChunkManager{ } } - if(isset($this->chunkPopulationRequestMap[$index = World::chunkHash($x, $z)]) && isset($this->activeChunkPopulationTasks[$index])){ + $index = World::chunkHash($x, $z); + if(!isset($this->chunkPopulationRequestMap[$index])){ + $this->logger->debug("Discarding population result for chunk x=$x,z=$z - promise was already broken"); + unset($this->activeChunkPopulationTasks[$index]); + }elseif(isset($this->activeChunkPopulationTasks[$index])){ if($dirtyChunks === 0){ $oldChunk = $this->loadChunk($x, $z); $this->setChunk($x, $z, $chunk);