Chisels & Bits - For Fabric

Chisels & Bits - For Fabric

2M Downloads

Server shuts down due to undetermined eligibility

Neywiny opened this issue ยท 8 comments

commented

For any bug reports please provide the following details as well,

  • MC Version: 1.12.2
  • C&B Version: 14.29
  • Do You have Optifine: No, but foam is installed

On server startup log is spammed with
[Server thread/INFO] [chiselsandbits]: Unable to determine blocks eligibility for chiseling,
which is fine because it's just a log, the problem is that it happens after the world starts up such that all of this checking is counting as a tick. After a while, apparently just over the 60000 ms mark of the default max tick config, server says
[10:42:56] [Server Watchdog/FATAL] [net.minecraft.server.dedicated.ServerHangWatchdog]: A single server tick took 60.25 seconds (should be max 0.05) [10:42:57] [Server Watchdog/FATAL] [net.minecraft.server.dedicated.ServerHangWatchdog]: Considering it to be crashed, server will forcibly shutdown. [10:43:02] [Server Watchdog/ERROR] [net.minecraft.server.dedicated.ServerHangWatchdog]: This crash report has been saved to: C:\Users\Neywiny\Documents\Curse\Minecraft\server\.\crash-reports\crash-2018-12-30_10.43.01-server.txt [10:43:02] [Server Shutdown Thread/INFO] [net.minecraft.server.MinecraftServer]: Stopping server [10:43:04] [Server Shutdown Thread/INFO] [net.minecraft.server.MinecraftServer]: Saving players
and then even after that the mod is still chucking stuff to the log. I've noticed that a lot of these issues on the repo say it's the fault of the other mods' authors, but there are so many different mods listed in the logs that it would be really great if this verification could be done before the game starts up. In the mean time I can increase the max tick of the server, but ideally this all wouldn't be counted as a tick.

Included mods listed are:

  • rwtema.extrautils2.transfernodes.BlockTransferPipe
  • rwtema.extrautils2.blocks.BlockCreativeHarvest
  • bdew.lib.multiblock.block.BlockController
  • bdew.lib.multiblock.block.BlockController
  • bdew.generators.modules.efficiency
  • bdew.lib.multiblock.block.BlockModule
  • bdew.generators.modules.turbine.BlockTurbine
  • bdew.generators.modules.powerCapacitor
  • QuantumStorage.blocks.AdvancedBlock
  • team.chisel.common.block.BlockCarvablePane
  • mrcrayfish.furniture.blocks.BlockDesk
  • mrcrayfish.furniture.blocks.BlockDeskCabinet
  • mrcrayfish.furniture.blocks.BlockDigitalClock
  • vswe.stevescarts.blocks.BlockDetector
  • raoulvdberge.refinedstorage.block.BlockWirelessTransmitter
  • valkyrieofnight.et.m_multiblocks.m_components.m_modifiers.block.BlockModifierNull
commented

C&B only checks for eligibility when something needs it to, which is usually when displaying the creative tab, or interacting with the world.

I would say that your likely seeing the result of this as part of another mods efforts to scan or do something. There is a good chance that not a lot can be done there, but its hard to say.

Rather then C&B just scanning all blocks at once for its own convince. The logging itself isn't so much an issue as is whatever is causing the game to freeze for a minute while it clearly has to come up with the results.

One major problem is that C&B has to do its calculations when the game is in a state where there is mapping data for states ( a world must be loaded )

So it can't really do them during the game load process, as mappings are save specific. I'd recommend profiling the game during that phase to send it to me, to see if there is something that can be done. ( https://ae-mod.info/profiling/ ) should give you details on how to do that, if you don't know how. Though obviously you'll just post the NPM here if you you do this.

But you might need to increase the watch dog timer in the end.

commented

I think you meant NPS like snapshot not NPM like Node Package Manager, or at least I hope so because I have the nps. Turns out that sometimes it doesn't do as many checks, idk why I think it was because I changed where my character was in the world but that doesn't make sense because nobody logged in yet. Anyway, it's here: https://drive.google.com/file/d/1JJg79-Zsg9Nau6d6d_Dou2ST8L3W-oE5/view?usp=sharing

Post review edit: the profiler says that of the 3952 ms for "onPreWorldTick()" C&B "BlockBitInfo.GetDeclaringClass()" takes up 3378, with 1617 for "getDeclaredMethod()" and 1518 for another "getDeclaredMethod()", idk how they're different but the second one is nested in some stuff

commented

yeah, NPS, According to that snapshot the mod responsible is mine colonies, and its calling into C&B to see if its items are compostable.

Though it says it only consumed 3 seconds, hardly the full minute of your issue.

I don't really think that this snapshot really shows the extent of what the issue really would be. Since C&B's code was only running for 5% of the length required for your issue.

commented

As I mentioned up in the first paragraph of the second comment, it varies for some reason. This is the paste for the one that shut the server down https://pastebin.com/n0vjusM5, as you can see C&B starts at the end of minute 41 and ends at the beginning of minute 43, It does this uninterpreted save for the watchdog timer saying to shut it down. I fear that as the world changes through play C&B might take 3.5 seconds or might take multiple minutes. In the meantime I've bumped the max tick to 10 minutes.

commented

I did read what you said, but that doesn't really change that there was 95% difference between the time it crashed, and the data I have.

The fact that there such a large variance suggests that there is something more complex at work. Unless we can get a snap shot of something that more closely resembles the crash itself, I'm not sure we can accuracy find any means to attack the problem. Such as blacklisting C&B from the other mods calculation, if there are options for that.

There is just not a lot I can do optimization wise, since I'm relying on java's reflection, and all of C&B's time is spent asking java to get class data, then checking the results of that happen almost immediately.

commented

Is it possible to look at how other mods do it? I saw that I think enderio has a painting thing now that registers a lot of blocks that iirc are from other mods. That has to have been done the first game tick because it probably takes forever. Or is it possible to check the class when the user is going to chisel the block? I don't know this stuff so I'll keep snapshotting every launch with an increased maximum tick, just throwing suggestions out.

commented

C&B uses the "Check the class on chisel" approach already. The problem, is that another mod, from what the NPS says, "Mine Colonies" is basically asking for all the chiseled bit variants. The only way to know that however, is to quickly run the check on every block in the game. Then return the list of all types of bits.

Hence why I was talking about black listing earlier.

commented

I see. I guess I'll remove one mod or the other. Thank you for your time, may the odds be ever in your favor.