Flush the log before a world server boot abort

tinylog's writing thread dropped queued lines on System.exit, so boot
aborts died with no error in the log. exitServer shuts the writing thread
down (flushing it) before exiting; every exit in WorldServer uses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-27 20:23:57 -04:00
1 parent c66ce6e777
commit 21975e0bed
1 file changed
+22 -16
+22 -16
View File
@@ -138,14 +138,20 @@ public class WorldServer {
if (retVal != 0)
Logger.error(
".exec() returned value: '" + retVal);
exit(retVal);
exitServer(retVal);
} catch (Exception e) {
Logger.error(e.getMessage());
exit(1);
exitServer(1);
}
}
// The tinylog writing thread drops queued lines on System.exit; flush them so boot aborts are logged
private static void exitServer(int status) {
Configurator.shutdownWritingThread(true);
exit(status);
}
public static String getUptimeString() {
String outString = null;
@@ -303,7 +309,7 @@ public class WorldServer {
if (CompoundCurveTemplate._curves == null || CompoundCurveTemplate._curves.isEmpty()) {
Logger.error("ABORT! Compound curves failed to load!");
exit(1);
exitServer(1);
}
CurveRamp.verifyRampForms();
@@ -313,7 +319,7 @@ public class WorldServer {
if (ModTypeTemplate._modTypes == null || ModTypeTemplate._modTypes.isEmpty()) {
Logger.error("ABORT! Mod types failed to load!");
exit(1);
exitServer(1);
}
Logger.info("Loading Power Actions");
@@ -321,7 +327,7 @@ public class WorldServer {
if (PowerActionTemplate._powerActions == null || PowerActionTemplate._powerActions.isEmpty()) {
Logger.error("ABORT! Power actions failed to load!");
exit(1);
exitServer(1);
}
Logger.info("Loading Effects");
@@ -329,7 +335,7 @@ public class WorldServer {
if (EffectTemplate._effects == null || EffectTemplate._effects.isEmpty()) {
Logger.error("ABORT! Effects failed to load!");
exit(1);
exitServer(1);
}
Logger.info("Loading Powers");
@@ -337,7 +343,7 @@ public class WorldServer {
if (PowerTemplate._powers == null || PowerTemplate._powers.isEmpty()) {
Logger.error("ABORT! Powers failed to load!");
exit(1);
exitServer(1);
}
Logger.info("Loading Skills");
@@ -345,7 +351,7 @@ public class WorldServer {
if (SkillTemplate._skills == null || SkillTemplate._skills.isEmpty()) {
Logger.error("ABORT! Skills failed to load!");
exit(1);
exitServer(1);
}
Logger.info("Loading SkillsBase");
@@ -356,7 +362,7 @@ public class WorldServer {
if (StartingKitTemplate._kits == null || StartingKitTemplate._kits.isEmpty()) {
Logger.error("ABORT! Starting kits failed to load!");
exit(1);
exitServer(1);
}
Logger.info("Loading Character Creation Runes");
@@ -364,7 +370,7 @@ public class WorldServer {
if (CharCreateRuneList._runeList == null) {
Logger.error("ABORT! Character creation runes failed to load!");
exit(1);
exitServer(1);
}
Logger.info("Loading Power Action Resource Costs");
@@ -372,7 +378,7 @@ public class WorldServer {
if (PowActionCostTemplate._costs == null || PowActionCostTemplate._costs.isEmpty()) {
Logger.error("ABORT! Power action resource costs failed to load!");
exit(1);
exitServer(1);
}
Logger.info("Initializing PowersManager.");
@@ -407,7 +413,7 @@ public class WorldServer {
if (DeedTemplate._deeds == null || DeedTemplate._deeds.isEmpty()) {
Logger.error("ABORT! Deed templates failed to load!");
exit(1);
exitServer(1);
}
Logger.info("Loading Rune Templates");
@@ -415,7 +421,7 @@ public class WorldServer {
if (RuneTemplate._runes == null || RuneTemplate._runes.isEmpty()) {
Logger.error("ABORT! Rune templates failed to load!");
exit(1);
exitServer(1);
}
Logger.info("Loading Cache Item Templates");
@@ -423,7 +429,7 @@ public class WorldServer {
if (ItemTemplate._items == null || ItemTemplate._items.isEmpty()) {
Logger.error("ABORT! Cache item templates failed to load!");
exit(1);
exitServer(1);
}
Logger.info("Indexing Cache Templates");
@@ -434,7 +440,7 @@ public class WorldServer {
if (CZoneTemplate._zones == null || CZoneTemplate._zones.isEmpty()) {
Logger.error("ABORT! Cache zone templates failed to load!");
exit(1);
exitServer(1);
}
ZoneManager.loadZoneTemplates();
@@ -539,7 +545,7 @@ public class WorldServer {
if (!ZoneManager.loadZones(worldMapID)) {
Logger.error("ABORT! Zone tree failed to load!");
exit(1);
exitServer(1);
}
Logger.info("Loading all Buildings");