Better Questing

Better Questing

39M Downloads

Lag spike on player join

Sir-Will opened this issue ยท 6 comments

commented
[10:52:05] [Thread Locksmith Watchdog/INFO]: -#-#-#- START THREAD LOCKSMITH -#-#-#-
[10:52:05] [Thread Locksmith Watchdog/INFO]: --- Thread 21 ---
[10:52:05] [Thread Locksmith Watchdog/INFO]: Name: Server thread
[10:52:05] [Thread Locksmith Watchdog/INFO]: Status: RUNNABLE
[10:52:05] [Thread Locksmith Watchdog/INFO]: Stacktrace:
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - java.io.FileOutputStream.open0(Native Method)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - java.io.FileOutputStream.open(FileOutputStream.java:270)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - java.io.FileOutputStream.<init>(FileOutputStream.java:213)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - java.io.FileOutputStream.<init>(FileOutputStream.java:162)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - com.google.common.io.Files.newWriter(Files.java:103)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - net.minecraft.server.management.PlayerProfileCache.func_152658_c(PlayerProfileCache.java:280)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - net.minecraft.server.management.PlayerProfileCache.func_152655_a(PlayerProfileCache.java:188)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - betterquesting.storage.NameCache.updateNames(NameCache.java:73)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - betterquesting.handlers.EventHandler.onPlayerJoin(EventHandler.java:316)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - cpw.mods.fml.common.eventhandler.ASMEventHandler_98_EventHandler_onPlayerJoin_PlayerLoggedInEvent.invoke(.dynamic)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - cpw.mods.fml.common.FMLCommonHandler.firePlayerLoggedIn(FMLCommonHandler.java:571)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - net.minecraft.server.management.ServerConfigurationManager.initializeConnectionToPlayer(ServerConfigurationManager.java:235)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeServerSideConnection(NetworkDispatcher.java:190)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeHandshake(NetworkDispatcher.java:465)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:21)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:11)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - cpw.mods.fml.common.network.internal.FMLProxyPacket.func_148833_a(FMLProxyPacket.java:77)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:244)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:173)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:991)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:431)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:809)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - net.minecraft.server.MinecraftServer.run(MinecraftServer.java:669)
[10:52:05] [Thread Locksmith Watchdog/INFO]:  - java.lang.Thread.run(Thread.java:745)
[10:52:05] [Thread Locksmith Watchdog/INFO]: -#-#-#- END THREAD LOCKSMITH -#-#-#-
commented

When a player joins the server there is a lag spike caused by betterquesting.storage.NameCache.updateNames(NameCache.java:73)
I don't have more information about that.

commented

What about the number of players? That would certainly be something notable. You could even open the NameCache.json file to see how many player names are trying to be cached and sent to clients.

commented

What is this? This doesn't particularly tell me a lot

commented

1300+ players in NameCache.json

commented

Well... uh... yea... that would do it. Guess I need rewrite that the sync multi-threading in mind if people are running servers with 1.3K users

commented

So it turns out Minecraft isn't particularly thread safe when it comes to querying player UUIDs and usernames so the current state is pretty much as good as I can get it for now. I still don't intend to fully support servers with excessive numbers of players on a single instance though.