Mojira Archive
MC-38134

Race condition in logging when shutting down

Occasionally, but not always, I get the following behaviour when shutting down the server

gsadmin:gsadmin@polaris:/storage/games/minecraft/17-test$ java -jar minecraft_server.1.7.2.jar --nogui
[11:25:00] [Server thread/INFO]: Starting minecraft server version 1.7.2
[11:25:00] [Server thread/INFO]: Loading properties
[11:25:00] [Server thread/INFO]: Default game type: SURVIVAL
[11:25:00] [Server thread/INFO]: Generating keypair
[11:25:00] [Server thread/INFO]: Starting Minecraft server on *:25567
[11:25:00] [Server thread/INFO]: Preparing level "world"
[11:25:00] [Server thread/INFO]: Preparing start region for level 0
[11:25:01] [Server thread/INFO]: Done (0.746s)! For help, type "help" or "?"

[11:25:10] [Server thread/INFO]: Unknown command. Try /help for a list of commands

[11:25:33] [Server thread/INFO]: Unknown command. Try /help for a list of commands
stop
[11:25:36] [Server thread/INFO]: Stopping the server
[11:25:36] [Server thread/INFO]: Stopping server
[11:25:36] [Server thread/INFO]: Saving players
[11:25:36] [Server thread/INFO]: Saving worlds
[11:25:36] [Server thread/INFO]: Saving chunks for level 'world'/Overworld
[11:25:36] [Server thread/INFO]: Saving chunks for level 'world'/Nether
[11:25:36] [Server thread/INFO]: Saving chunks for level 'world'/The End
[11:25:36] [Server Shutdown Thread/INFO]: Stopping server
2013-10-28 11:25:36,620 ERROR Attempted to append to non-started appender ServerGuiConsole
Exception in thread "Server Shutdown Thread" org.apache.logging.log4j.core.appender.AppenderLoggingException: Attempted to append to non-started appender ServerGuiConsole
        at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:89)
        at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:425)
        at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:406)
        at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:367)
        at org.apache.logging.log4j.core.Logger.log(Logger.java:110)
        at org.apache.logging.log4j.spi.AbstractLogger.info(AbstractLogger.java:1011)
        at net.minecraft.server.MinecraftServer.n(SourceFile:287)
        at kx.run(SourceFile:605)

Code analysis by Marcono1234 in this comment.