Skip to content

fix: crash and stability fixes with shutdown timeouts#11

Open
Xytronix wants to merge 1 commit intoIroriPowered:masterfrom
Xytronix:fix-crashfixes
Open

fix: crash and stability fixes with shutdown timeouts#11
Xytronix wants to merge 1 commit intoIroriPowered:masterfrom
Xytronix:fix-crashfixes

Conversation

@Xytronix
Copy link
Contributor

Summary

Adds defensive guards and exception handling to prevent crashes and hangs caused by corrupt/stale data, race conditions, and thread-safety issues.

I prevented the restarts happening with watchdog on multiple worlds and player joins crashing the server during startup.

Related issues

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (requires documentation/migration)
  • Chore / refactor
  • Documentation only

Implementation details

  • MixinBlockSectionSafety: Guards corrupt section deserialization
  • MixinStateSupport: Guards IllegalStateException in update()
  • MixinTurnOffTeleportersSystem: Defers portal block updates to world.execute() to avoid thread-safety crashes
  • MixinEntityChunkLoadingSystem: Guards null TransformComponent and empty archetypes
  • MixinPlayer: Redirects handleClientReady to the world thread, compatibility prevention patch (optional)
  • MixinMotionControllerBase: NaN guard on translation vector
  • MixinPortalDeviceSummonPage: Null guard on getSpawnTransform()
  • MixinMarkerAddRemoveSystem: Wraps onEntityAdded in MixinMarkerAddRemoveSystem.java for load-time resilience; redirects getNpcReferences() to pre-filter by UUID, preventing ArrayIndexOutOfBoundsException when stale data causes a size mismatch in the vanilla copy loop
  • MixinUniverse: Guards invalid MixinMarkerAddRemoveSystem.java in async removePlayer
  • MixinStore: Adds timeout to CompletableFuture.join() in shutdown0 to prevent indefinite blocking
  • MixinWorld: Adds timeout to CompletableFuture.join() in onShutdown world config save

Checklist

  • Code compiles successfully
  • Pull request does not contain unrelated changes
  • Changes follow this project's code style (Use spotlessApply when necessary)
  • Changes are tested or will be tested after submission

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant