WorldEdit

WorldEdit

43M Downloads

Too many blocks can cause the watchdog to timeout

octylFractal opened this issue ยท 1 comments

commented

Versions
WorldEdit version: 7.2.1
Platform version: 1.16.4

Describe the bug
With enough blocks, WorldEdit's registry initialization can take long enough that the watchdog kills the server, apparently. I'm not sure why WorldEdit is taking in excess of 60s here, but it clearly is.

To Reproduce

  1. Get a lot of blocks (or mods?)
  2. Load the game on a server.

Expected behavior
The game loads perfectly fine.

Additional context

Stacktrace
java.lang.Error: ServerHangWatchdog detected that a single server tick took 60.00 seconds (should be max 0.05)
	at java.util.HashMap$TreeNode.find(HashMap.java:1881) ~[?:1.8.0_265] {}
	at java.util.HashMap$TreeNode.find(HashMap.java:1877) ~[?:1.8.0_265] {}
	at java.util.HashMap$TreeNode.find(HashMap.java:1877) ~[?:1.8.0_265] {}
	at java.util.HashMap$TreeNode.getTreeNode(HashMap.java:1889) ~[?:1.8.0_265] {}
	at java.util.HashMap.getNode(HashMap.java:576) ~[?:1.8.0_265] {}
	at java.util.LinkedHashMap.get(LinkedHashMap.java:440) ~[?:1.8.0_265] {}
	at com.sk89q.worldedit.world.block.BlockState.lambda$populate$0(BlockState.java:125) ~[worldedit:?] {re:classloading}
	at com.sk89q.worldedit.world.block.BlockState$$Lambda$21783/1720106033.accept(Unknown Source) ~[?:?] {}
	at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:408) ~[server-1.16.4-20201102.104115-extra.jar:?] {re:mixin}
	at com.google.common.collect.RegularImmutableAsList.forEach(RegularImmutableAsList.java:62) ~[server-1.16.4-20201102.104115-extra.jar:?] {}
	at com.sk89q.worldedit.world.block.BlockState.populate(BlockState.java:123) ~[worldedit:?] {re:classloading}
	at com.sk89q.worldedit.world.block.BlockState.generateStateMap(BlockState.java:111) ~[worldedit:?] {re:classloading}
	at com.sk89q.worldedit.world.block.BlockType.lambda$new$3(BlockType.java:61) ~[worldedit:?] {re:classloading}
	at com.sk89q.worldedit.world.block.BlockType$$Lambda$21770/2048955728.get(Unknown Source) ~[?:?] {}
	at com.sk89q.worldedit.util.concurrency.LazyReference.getValue(LazyReference.java:68) ~[worldedit:?] {re:classloading}
	at com.sk89q.worldedit.world.block.BlockType.getBlockStatesMap(BlockType.java:91) ~[worldedit:?] {re:classloading}
	at com.sk89q.worldedit.world.block.BlockType.getAllStates(BlockType.java:175) ~[worldedit:?] {re:classloading}
	at com.sk89q.worldedit.extension.platform.Capability$4.initialize(Capability.java:92) ~[worldedit:?] {re:classloading}
	at com.sk89q.worldedit.extension.platform.PlatformManager.choosePreferred(PlatformManager.java:187) ~[worldedit:?] {re:classloading}
	at com.sk89q.worldedit.extension.platform.PlatformManager.handlePlatformReady(PlatformManager.java:300) ~[worldedit:?] {re:classloading}
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_265] {}
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_265] {}
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_265] {}
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_265] {}
	at com.sk89q.worldedit.util.eventbus.MethodEventHandler.dispatch(MethodEventHandler.java:58) ~[worldedit:?] {re:classloading}
	at com.sk89q.worldedit.util.eventbus.EventHandler.handleEvent(EventHandler.java:73) ~[worldedit:?] {re:classloading}
	at com.sk89q.worldedit.util.eventbus.EventBus.dispatch(EventBus.java:193) ~[worldedit:?] {re:classloading}
	at com.sk89q.worldedit.util.eventbus.EventBus.post(EventBus.java:181) ~[worldedit:?] {re:classloading}
	at com.sk89q.worldedit.forge.ForgeWorldEdit.serverStarted(ForgeWorldEdit.java:212) ~[worldedit:?] {re:classloading}
	at net.minecraftforge.eventbus.ASMEventHandler_169_ForgeWorldEdit_serverStarted_FMLServerStartedEvent.invoke(.dynamic) ~[?:?] {}
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-3.0.5-service.jar:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:297) ~[eventbus-3.0.5-service.jar:?] {}
	at net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerStarted(ServerLifecycleHooks.java:107) ~[forge:?] {re:classloading}
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:621) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:232) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer$$Lambda$20517/884574297.run(Unknown Source) ~[?:?] {}
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265] {}
commented

Probably fixed by e94f082, though maybe not entirely on Fabric.