Fixed shutdown teardown and shutdown staging wait

- Server stop defers teardown only while the plugin class loader close is held
- Shutdown with no Iris world loaded tears down during plugin disable
- Pre-unload hook drains generators inline when the class loader close cannot be held
- INMSBinding reports whether the class loader close is held
- Shutdown tests cover the held and unheld pre-unload paths
- Shutdown waits for an in-progress world replacement to finish staging
- Replacements started after shutdown begins are refused
- Admission tests cover the shutdown wait and the refusal
This commit is contained in:
SwiftSwamp committed 2026-10-26 09:26:30 -06:00
1 parent 494cdb1a5c
commit 2690e0878b
6 files changed
+169 -8

No files matched your search

@@ -301,7 +301,8 @@ public interface INMSBinding extends NativeTerrainAccess {
default void uninjectBukkit() {
}
default void deferPluginClassLoaderClose() {
default boolean deferPluginClassLoaderClose() {
return false;
}
default void releasePluginClassLoaderClose() {
@@ -30,7 +30,8 @@ public class BukkitBindingTest {
Fixture fixture = new Fixture();
when(fixture.lifecycle.isServerStopping()).thenReturn(true);
assertTrue(fixture.binding.isServerStopping());
fixture.binding.deferPluginClassLoaderClose();
when(fixture.lifecycle.deferPluginClassLoaderClose()).thenReturn(true);
assertTrue(fixture.binding.deferPluginClassLoaderClose());
fixture.binding.releasePluginClassLoaderClose();
verify(fixture.lifecycle).deferPluginClassLoaderClose();
verify(fixture.lifecycle).releasePluginClassLoaderClose();