fix: WorldTickManager dynamic lifecycle, AsyncEntityTracker latch exception safety, and SpawnerCreature spectator filtering - #163
Open
GamingOP69 wants to merge 7 commits into
Conversation
…eption safety, and SpawnerCreature spectator filtering
Corrected comment typo in WindSpigot world ticking logic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes memory leaks and index errors with dynamically loaded/unloaded worlds (Multiverse), prevents
AsyncEntityTrackerlatch deadlocks during exceptions, and corrects spectator filtering and mob cap counting inSpawnerCreature.Problem & Root Cause
WorldTickManagercached world tickers against a static list size rather than delegating to liveMinecraftServer.worlds. When worlds were dynamically loaded or unloaded at runtime by world management plugins, the ticker list became desynchronized, leading to memory leaks and tick index errors.AsyncEntityTrackerworker tasks did not performlatch.countDown()inside afinallyblock. If an entity tracker threw an exception during tracking, the countdown latch would never reach zero, deadlocking the main server thread waiting on the latch.EntityTrackerEntryhad an artificial 5-second tracking delay check that caused delay in players rendering when teleporting or entering view range.SpawnerCreaturehad an inverted spectator mode check and miscalculated mob caps by counting active chunks incorrectly.Solution
WorldTickManagerto iterate live worlds fromMinecraftServer.getServer().worldsand clean up tickers when worlds are unloaded.AsyncEntityTrackerlatch countdowns infinallyblocks to guarantee release under all conditions.EntityTrackerEntry.SpawnerCreature.WorldTickManagerLifecycleTest,AsyncTrackerLatchRegressionTest, andMobSpawningCapTest.