CivClassic / ExilePearl

For when you really just don't want that dude HERE but don't care if he plays - Paper plugin built for 1.16.5 Minecraft - Anti-grief tool built for players, not mods.
MIT License
0 stars 18 forks source link

Player skull lookup choking out server #60

Closed Maxopoly closed 4 years ago

Maxopoly commented 4 years ago

Loading the Hjaltland vault froze the server for about 30 seconds due to it doing a lookup for the skin in sync.

[08:58:28 ERROR]:               com.mojang.authlib.HttpAuthenticationService.performGetRequest(HttpAuthenticationService.java:130)                                                                      [157/99027]
[08:58:28 ERROR]:               com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:85)                                                                    
[08:58:28 ERROR]:               com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:186)                                                           
[08:58:28 ERROR]:               com.destroystokyo.paper.profile.PaperMinecraftSessionService.fillGameProfile(PaperMinecraftSessionService.java:38)                                                                 
[08:58:28 ERROR]:               com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:179)                                                     
[08:58:28 ERROR]:               com.destroystokyo.paper.profile.PaperMinecraftSessionService.fillProfileProperties(PaperMinecraftSessionService.java:31)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.TileEntitySkull$1.load(TileEntitySkull.java:80)                                     
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.TileEntitySkull$1.load(TileEntitySkull.java:47)                                                 
[08:58:28 ERROR]:               com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3716)                               
[08:58:28 ERROR]:               com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424)                      
[08:58:28 ERROR]:               com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298)
[08:58:28 ERROR]:               com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211)                     
[08:58:28 ERROR]:               com.google.common.cache.LocalCache.get(LocalCache.java:4154)                                                
[08:58:28 ERROR]:               com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158)                             
[08:58:28 ERROR]:               com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147)
[08:58:28 ERROR]:               com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5153)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.TileEntitySkull$3.call(TileEntitySkull.java:221)       
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.TileEntitySkull$3.call(TileEntitySkull.java:218)         
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.TileEntitySkull.b(TileEntitySkull.java:237)              
[08:58:28 ERROR]:               org.bukkit.craftbukkit.v1_16_R1.inventory.CraftMetaSkull.applyToItem(CraftMetaSkull.java:95)
[08:58:28 ERROR]:               org.bukkit.craftbukkit.v1_16_R1.inventory.CraftItemStack.setItemMeta(CraftItemStack.java:535)
[08:58:28 ERROR]:               org.bukkit.craftbukkit.v1_16_R1.inventory.CraftItemStack.asNMSCopy(CraftItemStack.java:42)
[08:58:28 ERROR]:               org.bukkit.craftbukkit.v1_16_R1.inventory.CraftInventory.setItem(CraftInventory.java:99)    
[08:58:28 ERROR]:               com.devotedmc.ExilePearl.listener.PlayerListener.onInventoryOpen(PlayerListener.java:150)    
[08:58:28 ERROR]:               com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor295.execute(Unknown Source)
[08:58:28 ERROR]:               org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69)                  
[08:58:28 ERROR]:               org.bukkit.plugin.EventExecutor$$Lambda$3797/1480833275.execute(Unknown Source)                  
[08:58:28 ERROR]:               co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80)                               
[08:58:28 ERROR]:               org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)                                     
[08:58:28 ERROR]:               org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607)                                           
[08:58:28 ERROR]:               org.bukkit.craftbukkit.v1_16_R1.event.CraftEventFactory.callInventoryOpenEvent(CraftEventFactory.java:1241)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.EntityPlayer.openContainer(EntityPlayer.java:1287)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.PlayerInteractManager.a(PlayerInteractManager.java:496)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.PlayerConnection.a(PlayerConnection.java:1451)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.PacketPlayInUseItem.a(PacketPlayInUseItem.java:27)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.PacketPlayInUseItem.a(PacketPlayInUseItem.java:5)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:23)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.PlayerConnectionUtils$$Lambda$4985/1380011687.run(Unknown Source)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.TickTask.run(SourceFile:18)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.MinecraftServer.aZ(MinecraftServer.java:1137)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.MinecraftServer.executeNext(MinecraftServer.java:1130)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeAll(IAsyncTaskHandler.java:95)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.MinecraftServer.a(MinecraftServer.java:1260)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:1001)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.MinecraftServer.lambda$a$0(MinecraftServer.java:177)
[08:58:28 ERROR]:               net.minecraft.server.v1_16_R1.MinecraftServer$$Lambda$2939/1145603405.run(Unknown Source)
[08:58:28 ERROR]:               java.lang.Thread.run(Thread.java:748)

Not sure how caching of skins works. If its persistent for the entire runtime, it'd be good enough to create a skull for them once on startup. If that's not the case and they're discarded every X minutes, then we likely need to revert the skull thing entirely

Maxopoly commented 4 years ago

Hmm, they keep them in one of those Guava caches with a timeout of 60 minutes

 public static final LoadingCache<String, GameProfile> skinCache = CacheBuilder.newBuilder()
            .maximumSize( 5000 )
            .expireAfterAccess( 60, TimeUnit.MINUTES )
            .build( new CacheLoader<String, GameProfile>()

and it's always sync. Guess we'll have to reverse migrate, restart with that and revert all git changes then to go back to the original state with pearls only.